screwloose
MIS
I am somewhat new to Solaris and am wondering how to handle the starting/stopping of applications upon system start/reboot.
I know that Solaris uses the S* and K* to start and stop applications, respectively. And also that the scripts are read alpha-numeric, e.g., S10apache is read before S15sendmail. I also know that custom scripts are put in /etc/init.d and linked to /etc/rc2.d or /etc/rc3.d.
One thing I am wondering looking at /sbin/rc2 is if I create a script in /etc/init.d do I have to name it something like ‘oracle.start.sh’ since I am not passing a start or stop?
for f in /etc/rc2.d/S*; do
if [ -s $f ]; then
case $f in
*.sh) . $f ;;
*) /sbin/sh $f start ;;
esac
fi
done
So if I name it /etc/init.d/oracle.start.sh then I would link it to /etc/rc2.d/S88oracle (or whatever number I choose). Is that correct?
Another thing I wonder is the /etc/rc2.d and /etc/rc3.d. If my servers are at run-level 3, do I link the start/stop scripts to /etc/rc2.d, /etc/rc3.d or both? A consultant with a company setting up the servers told me both because it depends. But my thought was that if you are at rc3 then it will run a K* or S* for rc3, rc2, rc1, rc0; and for a rc2 it would run rc2, rc1, rc0. Therefore if I link to /etc/rc2.d then my custom scripts would be started/stopped at either run-level 2 or 3. But he says not so. But he also said to me that max filesystem size is based on whether you run a 32- or 64-bit kernel, which in AIX is not true because it is based on filesystem type: JFS or JFS2, not on the kernel (I would think that is true for Solaris, too. Don’t know how it could be different).
Thanks!
I know that Solaris uses the S* and K* to start and stop applications, respectively. And also that the scripts are read alpha-numeric, e.g., S10apache is read before S15sendmail. I also know that custom scripts are put in /etc/init.d and linked to /etc/rc2.d or /etc/rc3.d.
One thing I am wondering looking at /sbin/rc2 is if I create a script in /etc/init.d do I have to name it something like ‘oracle.start.sh’ since I am not passing a start or stop?
for f in /etc/rc2.d/S*; do
if [ -s $f ]; then
case $f in
*.sh) . $f ;;
*) /sbin/sh $f start ;;
esac
fi
done
So if I name it /etc/init.d/oracle.start.sh then I would link it to /etc/rc2.d/S88oracle (or whatever number I choose). Is that correct?
Another thing I wonder is the /etc/rc2.d and /etc/rc3.d. If my servers are at run-level 3, do I link the start/stop scripts to /etc/rc2.d, /etc/rc3.d or both? A consultant with a company setting up the servers told me both because it depends. But my thought was that if you are at rc3 then it will run a K* or S* for rc3, rc2, rc1, rc0; and for a rc2 it would run rc2, rc1, rc0. Therefore if I link to /etc/rc2.d then my custom scripts would be started/stopped at either run-level 2 or 3. But he says not so. But he also said to me that max filesystem size is based on whether you run a 32- or 64-bit kernel, which in AIX is not true because it is based on filesystem type: JFS or JFS2, not on the kernel (I would think that is true for Solaris, too. Don’t know how it could be different).
Thanks!