[Opendnssec-user] Deprecating pid-files?
Ondřej Surý
ondrej at sury.org
Wed Aug 25 12:06:59 UTC 2010
On Tue, Aug 24, 2010 at 14:54, Jakob Schlyter <jakob at kirei.se> wrote:
> On 24 aug 2010, at 14.52, Ondřej Surý wrote:
>
>> Please don't remove pidfiles. It's important to keep them in case the
>> daemon is stuck and c&c interface doesn't work (or somebody removes
>> the socket by accident, or ...). In that case the init.d script needs
>> to kill the process by it's pid number and pidfile comes handy.
>
> It just kills whatever process found in that pidfile?
>
> Does the Debian init-scripts first try to stop using the c&c, wait, then stop using kill?
Debian uses following snippet to stop the daemons:
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5
--pidfile $PIDFILE
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
Ondrej
--
Ondřej Surý <ondrej at sury.org>
More information about the Opendnssec-user
mailing list