Re: [SLE] Running a daemon automatically at a runlevel
Hello, this appears to be a pretty old topic. Embedded comment follows: On Sun, Nov 14, 1999 at 07:25:43PM -0500, Bob Easton wrote:
On 14 Nov 99, at 14:42, Paul W. Abrahams wrote with subject "Re: [SLE] Running a daemon automatically at a run":
"Argentium G. Tiger" wrote:
Hi folks, I was working out how to make the Linux glibc2.1 version of the RC5DES client from distributed.net run automatically upon entry to Runlevel 2, and exit automatically on leaving Runlevel 2.
For some of you this might be old news, for some who are coming over from Windoze (as I am), this might make a nice example of how to get your head wrapped around how to do "autoexec.bat" like things in linux:
etc.
Your method works, 'tis true, but it can come back to kick you later on if you update your configuration. Problem is that Yast basically regards the stuff in /sbin/init.d as its property, to be changed at will if you update your system. So your changes to /sbin/init.d/rc2.d might be clobbered some day.
I'd think it would be safer to put your code into /sbin/init.d/boot.local and do a runlevel test there (I'll admit I don't know what the right variable for that is, though). There's also a local shutdown file somewhere, though I don't know what it is.
Pardon my ignorance, but is boot.local invoked for every runlevel change? more...
I've concluded that if you're ever likely to update a SuSE system, it's a good idea to keep all your local changes under a local directory or in a recognizably local file like boot.local. If you set up your search paths to look at local stuff first, then you can override anything you want.
Well, I guess that answers my last question although I don't fully understand it, but it seems inelegant at any rate. Isn't there a more seamless way to integrate such scripts into the init sequence? more...
Any wiser heads around here have a different view?
Paul
This sounds like something that SuSE should offer an opinion on. For example, I don't know how best to integrate dhcpcd into the current scripts so that a) it will be started and stopped by the appropriate runlevel change AND b) not be trampled by upgrades. BTW, will SuSE offer dhcpcd as an option? It's much more full- featured and well documented, in addition to having been tested on several cable modem systems. It worked immediately by simply issuing "dhcpcd eth0" from the command line whereas dhclient only worked once for me in 6.1, and I'll be damned if I know why it ever worked or didn't work as the case may be. -Bob
I would also like to know SuSE's recommendation for installing daemons that are not retrieved through YaST as RPM. Up until now, I have been creating sym-links by hand which is a real pain. Redhat put out a program called chkconfig, but I have had problems getting it to work correctly. I hear Debian also has a similar program, but was unable to find it. Concerning your stuff getting clobbered: Back it up. I think its silly that users are unable to this directory. Shouldn't there be another similar directory located in '/usr/local/sbin/init.d' that will remain untouched by YaST? Guess we could always turn off ENABLE_SUSECONFIG, but what other problems will that raise? Looks like in the meantime I will be using csh to create those sym-links. -- [-=-=-=-=-=-=-=-=-=-=- adam j henry =-=-=-=-=-=-=-=-=-=-=] | [http: www.heidelberg.edu/~ahenry] [pgp: 0x92B1EDF5] | | [mailto: ahenry@heidelberg.edu] [icq: 5794025] | [-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=] -- 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/Doku/FAQ/
The SuSE manual explains the runlevel concepts pretty well. It even gives you instructions on how to add your own scripts. In short, if you create a script, say "your_script", and create the symbolic links as described below, /sbin/init.d/your_script /sbin/init.d/rc2.d/K15your_script -> ../your_script /sbin/init.d/rc2.d/S20your_script -> ../your_script /sbin/init.d/rc3.d/K15your_script -> ../your_script /sbin/init.d/rc3.d/S20your_script -> ../your_script you will see it started when you enter run levels 2 or 3. I don't think Yast clobbers manually added init scripts during a system update or any other time. What you should have is a backup and a shell script that will reinstall the script when needed. -- Rafael Herrera -- 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/Doku/FAQ/
participants (2)
-
ahenry@cusa.dyndns.org
-
raffo@neuronet.pitt.edu