On Wed, 2010-06-23 at 11:30 +0200, Per Jessen wrote:
Roger Oberholtzer wrote:
1. If a daemon started in an rc script fails, how to get it to be started again? I know how to do this with inittab. But individual rc scripts are not usually managed this way. The rc script uses the startproc function to start the daemon. Is there a way to tell that to restart the script if it exits? Or do I need to move the rc script to inittab? That would mean fiddling with the openSUSE RMS's installation, which is potentially problematic if the RPM gets updated.
I tend to wrap such problematic daemons in a short restart-script. That way I know when it is restarted and I can control it.
I do the same for daemons I start in my own rc scripts. Instead of startproc, I do this in the 'start' part of the rc script: while [ 1 ]; do myDaemon >/var/log/myDaemon.log 2>&1; done & This starts a shell that simply runs the daemon forever. Of course, this breaks the 'status' and 'stop' commands as the pid is not maintained as startproc does. But my bigger concern is that the daemon never goes away. I have no trouble doing this with the vblade RC script that is in the openSUSE vblade RPM. I would need to change that script as it starts the daemon in the background and exits. I guess the -w option to startproc will solve that. But then the script cannot be used as an rc script. But I guess it would then work in inittab. I guess I will have to be sure to maintain an inittab-always-running version of the script in the currently installed vblade. Messy messy. -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org