Starting a self-built process at boot time
Hi.
I did a bit of Googling around but was not able to find a suitable answer, so here goes... I compiled OpenSSH for Solaris 2.7. The "uname -a" commands yields the following. Code:
SunOS sparc-dual7 5.7 Generic_106541-20 sun4u sparc SUNW,Ultra-250 Code:
/usr/local/sbin/sshd -f /usr/local/etc/sshd_config Any help would be appreciated. TIA, Dai |
Put your start script in /etc/rc3.d/S99sshd
|
Make sure your script has a
Code:
case "$1" in |
I'm sorry to tell it will start even without that. The rc launcher does not parse the scripts expecting a structure, it just executes them.
Of course, using such a construction is more elegant, is the usual way it is done and allows to enhance the script to stop the service too. |
Really ? I always thought that it passed "start" to all the S ones and stop to all the K ones ?
From /etc/init.d/README "File names in rc?.d directories are of the form [SK]nn<init.d filename> where 'S' means start this job, 'K' means kill this job, and 'nn' is the relative sequence number for killing or starting the job. When executing each script in one of the /etc/rc[S0-6] directories, the /sbin/rc[S0-6] script passes a single argument. It passes the argument 'stop' for scripts prefixed with 'K' and the argument 'start' for scripts prefixed with 'S'. There is no harm in applying the same sequence number to multiple scripts. In this case the order of execution is deterministic but unspecified. It is recommended that scripts be hard-linked from the same file stored in /etc/init.d/." But I could be wrong |
Yes, that's true. But it's also true that one script that receives whichever parameter can just ignore it: one thing is receiving, another thing is using.
Besides, if you respect that structure you can write only one script to start, stop, restart, etc. and using that parameter to switch between behaviours. Bye, Enrico. |
All times are GMT -5. The time now is 04:37 PM. |