https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285742

Dave Cottlehuber <d...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |Works As Intended
             Status|New                         |Closed

--- Comment #3 from Dave Cottlehuber <d...@freebsd.org> ---
The rc framework doesn't handle this case, users need to add a few lines to
accommodate it

pidfile="/var/run/${name}.pid"
daemon_pidfile="/var/run/${name}-daemon.pid"
procname="%%PREFIX%%/sbin/homunculus"
command="/usr/sbin/daemon"
command_args="-f -c -R 5 -r -T ${name} -p ${pidfile} -P ${daemon_pidfile}
${procname} ${homunculus_args}"

start_precmd=homunculus_startprecmd
stop_postcmd=homunculus_stoppostcmd

homunculus_startprecmd()
{
        if [ ! -e ${daemon_pidfile} ]; then
                install -o ${homunculus_user} -g ${anubis_group} /dev/null
${daemon_pidfile};
        fi
        if [ ! -e ${pidfile} ]; then
                install -o ${homunculus_user} -g ${anubis_group} /dev/null
${pidfile};
        fi
}


homunculus_stoppostcmd()
{
        if [ -f "${daemon_pidfile}" ]; then
                pids=$( pgrep -F ${daemon_pidfile} 2>&1 )
                _err=$?
                [ ${_err} -eq 0 ] && kill -9 ${pids}
        fi
}

run_rc_command "$1"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to