From 034cb862232bdfddd7bb607018f7d3a96db1c411 Mon Sep 17 00:00:00 2001 From: vs Date: Thu, 10 Mar 2005 16:27:39 +0000 Subject: - Add rcng'ified startup-script - Move pid-file to /var/spool/jabber/ (/var/run/ would be better but we can't use it since jabberd drops its privs to early) PR: ports/77028 Submitted by: Vivek Khera --- net-im/jabber/files/jabberd.sh | 63 +++++++++++++++++------------------- net-im/jabber/files/patch-jabber.xml | 2 +- 2 files changed, 31 insertions(+), 34 deletions(-) (limited to 'net-im/jabber/files') diff --git a/net-im/jabber/files/jabberd.sh b/net-im/jabber/files/jabberd.sh index 109855681eff..d0facc8f5257 100644 --- a/net-im/jabber/files/jabberd.sh +++ b/net-im/jabber/files/jabberd.sh @@ -1,38 +1,35 @@ #!/bin/sh +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jabberd\.sh\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi +# PROVIDE: jabber +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable rsyncd: +# +#jabber_enable="YES" +# + +. /usr/local/etc/rc.subr + +name=jabber +rcvar=`set_rcvar` + +command=/usr/local/sbin/jabberd +required_files=/usr/local/etc/${name}.xml -USER="jabber" -RUNDIR="/var/tmp" HOSTNAME=`/bin/hostname` -test -x ${PREFIX}/sbin/jabberd || exit 1 - -export PATH=/sbin:/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin -umask 077 - -echo -n " jabberd " -cd ${RUNDIR} || exit - -case ${1:-start} in -start) - 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; -esac +# set defaults + +jabber_enable=${jabber_enable:-"NO"} +jabber_pidfile=${jabber_pidfile:-"/var/spool/jabber/${name}.pid"} +jabber_flags=${jabber_flags:-"-B -h ${HOSTNAME} -c ${required_files}"} +jabber_user=${jabber_user:-"jabber"} +jabber_group=${jabber_group:-"jabber"} + +pidfile=${jabber_pidfile} + +load_rc_config ${name} +run_rc_command "$1" diff --git a/net-im/jabber/files/patch-jabber.xml b/net-im/jabber/files/patch-jabber.xml index 378893a1aea6..925184122ed1 100644 --- a/net-im/jabber/files/patch-jabber.xml +++ b/net-im/jabber/files/patch-jabber.xml @@ -43,7 +43,7 @@ This specifies the file to store the pid of the process in. --> - ./jabber.pid -+ /var/tmp/jabber.pid ++ /var/spool/jabber/jabber.pid -- cgit