ports/75824: [patch] rc.d/jabberd.sh

oss-freebsd-ports at technorama.net oss-freebsd-ports at technorama.net
Tue Jan 4 22:20:29 UTC 2005


>Number:         75824
>Category:       ports
>Synopsis:       [patch] rc.d/jabberd.sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 04 22:20:28 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        FreeBSD 5.2.1-RELEASE-p13 i386
>Organization:
>Environment:
System: FreeBSD technorama.net 5.2.1-RELEASE-p13 FreeBSD 5.2.1-RELEASE-p13 #1: Tue Jan 4 14:56:57 EST 2005 root at technorama.net:/usr/src/sys/i386/compile/TECHNORAMA i386


>Description:

	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.

>How-To-Repeat:

	# [machine crashes, jabberd dies, `killall jabberd`]
	/usr/local/etc/rc.d/jabberd.sh start
	# jabberd fails to start

>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;


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list