summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorvs <vs@FreeBSD.org>2005-02-01 11:12:05 +0000
committervs <vs@FreeBSD.org>2005-02-01 11:12:05 +0000
commit02b01044b8d58a9f07f9a7b63bda7ccd7253a874 (patch)
treee484c6aaea260ec4c035c877ea99a8da83f22181 /net
parent166a10abc6f0d70a613c42b2efffb4eb1f2420be (diff)
downloadFreeBSD-ports-02b01044b8d58a9f07f9a7b63bda7ccd7253a874.zip
FreeBSD-ports-02b01044b8d58a9f07f9a7b63bda7ccd7253a874.tar.gz
After a crash jabberd refuses to run if a pidfile exists.
Check if a process with the pid contained in jabber.pid is running and removes the file if not. PR: ports/75824 Submitted by: oss-freebsd-ports AT technorama DOT net
Diffstat (limited to 'net')
-rw-r--r--net/jabber/Makefile1
-rw-r--r--net/jabber/files/jabberd.sh13
2 files changed, 13 insertions, 1 deletions
diff --git a/net/jabber/Makefile b/net/jabber/Makefile
index af131af..a3431e6 100644
--- a/net/jabber/Makefile
+++ b/net/jabber/Makefile
@@ -7,6 +7,7 @@
PORTNAME= jabber
PORTVERSION= 1.4.3.1
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://devel.amessage.info/jabberd14/
DISTNAME= ${PORTNAME}d-${PORTVERSION}
diff --git a/net/jabber/files/jabberd.sh b/net/jabber/files/jabberd.sh
index 2ad8b7e..1098556 100644
--- a/net/jabber/files/jabberd.sh
+++ b/net/jabber/files/jabberd.sh
@@ -19,8 +19,19 @@ cd ${RUNDIR} || exit
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;
OpenPOWER on IntegriCloud