rc-scripts and /var/run/somedir/service.pid

Tomasz Pala gotar at polanet.pl
Fri Apr 8 14:31:17 CEST 2005


Most of out initscripts don't cope with pidfiles located in dirs other
than /var/run (well, they don't use it as they could). E.g.:

status()

        # Next try "/var/run/*.pid" files
        if [ -f /var/run/${base}.pid ]; then
                read pid < /var/run/${base}.pid


killproc()

        # Remove pid file if any.
        if [ "$notset" = "1" ]; then
                rm -f /var/run/${base}.pid
        fi


At least:

pidofproc()

        pidfile="$base.pid"
        [ -n "$2" ] && pidfile="$2"


I remind you, that there is --pidfile option to killproc. Argument is
relative to /var/run directory, so we can do for example:

killproc --pidfile clamav/clamd.pid clamd

instead of:

killproc clamd

Also, there's no full information in msg_usages (init.d/functions):

msg_usage " daemon [--user user] [--fork] [+/-nicelevel] {program}"
(missing [--check] [--waitforname] [--waitfortime])

msg_usage " killproc {program} [signal]"
(missing [--pidfile] [--waitforname] [--waitfortime])

msg_usage " pidofproc {program}"
(missing [$pidfile])

HGW gdzie i jak to commitować, żeby nie ściągać 100MB z
svn/rc-scripts...

-- 
GoTaR <priv0.onet.pl->gotar>        http://vfmg.sourceforge.net/
                                    http://tccs.sourceforge.net/




More information about the pld-devel-en mailing list