adding a startup script to /etc/init.d??
Back in 6.4 to add a startup scipt for init all you had to do was place it in /sbin/init.d and then make Sxxscript Kxxscript links in the run-level dir tree off init.d. I know the locatation has changed to /etc/init.d but it seems that the process must have changed also as I can't get it to work doing the same thing as I did in 6.4. Whats the new trick?? Yes I've read some of the docs. The only thing different that I see is something about insserv. Is that the key to getting this to work. It doesn't seem to help me. -- Mark Hounschell dmarkh@cfl.rr.com
You can actually place the script anywhere, just create a symbolic link
withan uppercase 'S' or 'K' and the appropriate number. You can call the
link whatever you like.
ex:
You have a script called apache in /root.
cd /etc/init.d/rc3.d
ln -s /root/apache S80start_web_server
cd /etc/init.d/rc1.d
ln -s /root/apache K50stop_web_server
/root/apache must be executable and owned by root.
However, ideally, scripts are placed in /etc/init.d and symbolically linked
from the appropriate run level directory. It is also good practice to name
the symbolic link the same as the script, ie: S80apache. You also need to
look when other services are stopped/started and decide on a logical place
in the sequence to start/stop your process. There is no need to start a web
server before you interfaces and routing have been configured..
On a sidenote, to disable something from starting/stopping automatically,
rename the link to a lower case 's' or 'k' so you can always reference where
it used to be.
Hope this helps,
CC
----- Original Message -----
From: "Mark Hounschell"
Back in 6.4 to add a startup scipt for init all you had to do was place it in /sbin/init.d and then make Sxxscript Kxxscript links in the run-level dir tree off init.d. I know the locatation has changed to /etc/init.d but it seems that the process must have changed also as I can't get it to work doing the same thing as I did in 6.4. Whats the new trick?? Yes I've read some of the docs. The only thing different that I see is something about insserv. Is that the key to getting this to work. It doesn't seem to help me.
-- Mark Hounschell dmarkh@cfl.rr.com
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
On Sun, Apr 15, 2001 at 04:05:48PM -0700, Rhugga wrote:
You can actually place the script anywhere, just create a symbolic link withan uppercase 'S' or 'K' and the appropriate number. You can call the link whatever you like.
ex: You have a script called apache in /root.
cd /etc/init.d/rc3.d ln -s /root/apache S80start_web_server cd /etc/init.d/rc1.d ln -s /root/apache K50stop_web_server
/root/apache must be executable and owned by root.
However, ideally, scripts are placed in /etc/init.d and symbolically linked from the appropriate run level directory. It is also good practice to name the symbolic link the same as the script, ie: S80apache. You also need to look when other services are stopped/started and decide on a logical place in the sequence to start/stop your process. There is no need to start a web server before you interfaces and routing have been configured..
On a sidenote, to disable something from starting/stopping automatically, rename the link to a lower case 's' or 'k' so you can always reference where it used to be.
Hope this helps, CC
This is correct up till the point SuSEconfig is run. On 7.1 you need to have dependencies discribed in your script. If you have no dependencies, the links to your script will be recreated with wrong numbers. I learnt it the hard way. I like to have fetchmail running as a daemon. I created a script and placed it in /etc/init.d directory, then created links to start/stop it at appropriate run levels. It worked great on 6.4. After upgrade to 7.1 my links got recreated by SuSEconfig with wrong numbers. So fetchmail was attempted to start even before starting network! I then sat and read man page of insserv. It was easy, just add lines to my fetchmail script to describe dependencies. In my case it is: ### BEGIN INIT INFO # Provides: fetchmail # Required-Start: $network sendmail # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: # Description: Fetchmail as a daemon ### END INIT INFO Then I just run insserv /etc/init.d/fetchmail and proper links are created. It really worth updating home-grown scripts to include dependency information in them -Kastus
----- Original Message ----- From: "Mark Hounschell"
To: Sent: Sunday, April 15, 2001 4:38 AM Subject: [SLE] adding a startup script to /etc/init.d?? Back in 6.4 to add a startup scipt for init all you had to do was place it in /sbin/init.d and then make Sxxscript Kxxscript links in the run-level dir tree off init.d. I know the locatation has changed to /etc/init.d but it seems that the process must have changed also as I can't get it to work doing the same thing as I did in 6.4. Whats the new trick?? Yes I've read some of the docs. The only thing different that I see is something about insserv. Is that the key to getting this to work. It doesn't seem to help me.
-- Mark Hounschell dmarkh@cfl.rr.com
"Konstantin (Kastus) Shchuka" wrote:
[...]
This is correct up till the point SuSEconfig is run. On 7.1 you need to have dependencies discribed in your script. If you have no dependencies, the links to your script will be recreated with wrong numbers.
I learnt it the hard way. I like to have fetchmail running as a daemon. I created a script and placed it in /etc/init.d directory, then created links to start/stop it at appropriate run levels.
It worked great on 6.4. After upgrade to 7.1 my links got recreated by SuSEconfig with wrong numbers. So fetchmail was attempted to start even before starting network!
I then sat and read man page of insserv. It was easy, just add lines to my fetchmail script to describe dependencies.
In my case it is:
### BEGIN INIT INFO # Provides: fetchmail # Required-Start: $network sendmail # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: # Description: Fetchmail as a daemon ### END INIT INFO Then I just run insserv /etc/init.d/fetchmail and proper links are created.
It really worth updating home-grown scripts to include dependency information in them
-Kastus
Thanks Kastus, this explains why after installing a few packages the order of my "rearranged" bootscripts was set back to "crash mode". Running SuSEconfig on other occasions didn't change it back, but I'll dive into that script and make sure this won't happen again. Thanks :-) Juergen -- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\
"Konstantin (Kastus) Shchuka" wrote:
On Sun, Apr 15, 2001 at 04:05:48PM -0700, Rhugga wrote:
You can actually place the script anywhere, just create a symbolic link withan uppercase 'S' or 'K' and the appropriate number. You can call the link whatever you like.
ex: You have a script called apache in /root.
cd /etc/init.d/rc3.d ln -s /root/apache S80start_web_server cd /etc/init.d/rc1.d ln -s /root/apache K50stop_web_server
/root/apache must be executable and owned by root.
However, ideally, scripts are placed in /etc/init.d and symbolically linked from the appropriate run level directory. It is also good practice to name the symbolic link the same as the script, ie: S80apache. You also need to look when other services are stopped/started and decide on a logical place in the sequence to start/stop your process. There is no need to start a web server before you interfaces and routing have been configured..
On a sidenote, to disable something from starting/stopping automatically, rename the link to a lower case 's' or 'k' so you can always reference where it used to be.
Hope this helps, CC
This is correct up till the point SuSEconfig is run. On 7.1 you need to have dependencies discribed in your script. If you have no dependencies, the links to your script will be recreated with wrong numbers.
I learnt it the hard way. I like to have fetchmail running as a daemon. I created a script and placed it in /etc/init.d directory, then created links to start/stop it at appropriate run levels.
It worked great on 6.4. After upgrade to 7.1 my links got recreated by SuSEconfig with wrong numbers. So fetchmail was attempted to start even before starting network!
I then sat and read man page of insserv. It was easy, just add lines to my fetchmail script to describe dependencies.
In my case it is:
### BEGIN INIT INFO # Provides: fetchmail # Required-Start: $network sendmail # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: # Description: Fetchmail as a daemon ### END INIT INFO Then I just run insserv /etc/init.d/fetchmail and proper links are created.
It really worth updating home-grown scripts to include dependency information in them
-Kastus
Got it. I think I like insserv.... -- Mark Hounschell dmarkh@cfl.rr.com
Mark Hounschell wrote:
Back in 6.4 to add a startup scipt for init all you had to do was place it in /sbin/init.d and then make Sxxscript Kxxscript links in the run-level dir tree off init.d. I know the locatation has changed to /etc/init.d but it seems that the process must have changed also as I can't get it to work doing the same thing as I did in 6.4. Whats the new trick?? Yes I've read some of the docs. The only thing different that I see is something about insserv. Is that the key to getting this to work. It doesn't seem to help me.
Exactly. I would have thought the same. Actually, my laptop crashes on bootup when the network card is in and alsa started before pcmcia. I changed the startorder, what means the idea works in generel. Did you take in account that the run levels changed with 7.1?? run level 2 moved to 3 (I think) and 3 moved to 5. Juergen -- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\
participants (4)
-
Juergen Braukmann
-
Konstantin (Kastus) Shchuka
-
Mark Hounschell
-
Rhugga