❦ 6 novembre 2013 17:43 CET, Marko Randjelovic <markoran@eunet.rs> :
>> That's exactly how I feel when I want to create a small daemon using a
>> SystemV init script. I feel like building an airplane from scratch while
>> I would just use a bike.
>
> Use /etc/init.d/skeleton and you'll see it's very simple.
The restart part of this script is buggy and documented as this:
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
This is why we have so many scripts with "sleep". On 138 init.d script I
have on my system, 52 are using sleep. This is full of race
conditions. If your system is slow, a restart will likely fail because
sleep will not wait enough time.
--
panic ("Splunge!");
2.2.16 /usr/src/linux/drivers/scsi/psi240i.c
Attachment:
signature.asc
Description: PGP signature