After a crash jabberd refuses to run if a pidfile exists. The patch below checks if a process with the pid contained in jabber.pid is running and removes the file if not. Fix: -- /usr/local/etc/rc.d/jabberd.sh.orig Thu Oct 7 11:54:28 2004 +++ /usr/local/etc/rc.d/jabberd.sh Tue Jan 4 16:04:59 2005 @@ -19,8 +19,19 @@ case ${1:-start} in start) - su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml" ;; + if [ -f jabber.pid ]; then + pid=`cat jabber.pid` + if [ ! -z "$pid" ] && kill -0 -- "$pid"; then + echo "A pidfile already exists at the specified location." + echo "Check to ensure another copy of the server is not running, or remove the existing file." + exit 1 + fi + rm -f ${RUNDIR}/jabber.pid; + fi + + su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml" + ;; stop) killall -SIGKILL -u ${USER} jabberd; rm -f ${RUNDIR}/jabber.pid; How-To-Repeat: # [machine crashes, jabberd dies, `killall jabberd`] /usr/local/etc/rc.d/jabberd.sh start # jabberd fails to start
State Changed From-To: open->feedback Forwarded PR to maintainer; tweaked synopsis
Dear maintainer, please review the proposed patch! Volker
On Friday 07 January 2005 06:04, Volker Stolz wrote: > Dear maintainer, please review the proposed patch! There are a couple of problems with the patch (and my interaction with it): 1) The PR was submitted against net/jabberd (of which I am the maintainer), the the patch is actually against net/jabber (of which I am not). 2) Would this be an appropriate time to switch that file to use rc.subr, rather than continuing to patch the old version? It otherwise looks as though it would work as expected. -- Kirk Strauser
State Changed From-To: feedback->closed Committed, thanks!