aboutsummaryrefslogtreecommitdiff
path: root/net-im/jabber/files
diff options
context:
space:
mode:
authorVolker Stolz <vs@FreeBSD.org>2005-02-01 11:12:05 +0000
committerVolker Stolz <vs@FreeBSD.org>2005-02-01 11:12:05 +0000
commit6554026e0c8a3eae66a2091af726c67091df9109 (patch)
treed3a37a3081e0c36ab08d2b36d2037d06f9df8587 /net-im/jabber/files
parent9e316137cc733b90480c0b0f026f27390840cfcd (diff)
downloadports-6554026e0c8a3eae66a2091af726c67091df9109.tar.gz
ports-6554026e0c8a3eae66a2091af726c67091df9109.zip
Notes
Diffstat (limited to 'net-im/jabber/files')
-rw-r--r--net-im/jabber/files/jabberd.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/net-im/jabber/files/jabberd.sh b/net-im/jabber/files/jabberd.sh
index 2ad8b7ea99c7..109855681eff 100644
--- a/net-im/jabber/files/jabberd.sh
+++ b/net-im/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;