Forum: Cfengine Help
Subject: Re: Stopping cf-execd?
Author: babudro
Link to topic: https://cfengine.com/forum/read.php?3,18691,19540#msg-19540

I use the init script to start & stop daemons.  Looking at 
/etc/init.d/cfengine3 (I believe I got this one with the 3.0.5p1 RPM) I see 
three ways it handles a "stop" depending on *nix flavour:  killproc, pkill, and 
start-stop-daemon.

If I'm reading it right, pkill gets called if you are not running SuSE, then 
called again if you are running Redhat/CentOS/Fedora, then called again if you 
are not running Debian.  So if you run Redhat/CentOS/Fedora it looks like you 
get three pkills, with SuSE you get killproc followed by pkill, and with Debian 
you would get a pkill followed by a start-stop-daemon.  Perhaps/probably this 
was not intended; I would just try the one command targeted for your 
distribution.


    "stop")
        set +e
        DAEMON=`basename $DAEMON`
    # openSuSE
        if [ "$SUSE" = "1" ]; then
        /sbin/killproc -TERM "$DAEMON" "$@"
        else
        pkill `basename $DAEMON` 2>/dev/null
        fi
    # Redhat/CentOS/Fedora
        if [ "$RedHat" = "1" ]; then
        pkill `basename $DAEMON` 2>/dev/null
        fi
    # Debian/Ubuntu
        if [ "$DEBIAN" = "1" ]; then
        start-stop-daemon -o --stop --retry 5 --verbose --name "$DAEMON" "$@"
        else
        pkill `basename $DAEMON` 2>/dev/null
        fi
        test $? = "0" || RETVAL=1
        set -e
        $ECHO "$DAEMONNAME stopped.             "
        ;;


_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to