aboutsummaryrefslogtreecommitdiff
path: root/net-im/jabber
diff options
context:
space:
mode:
authorVolker Stolz <vs@FreeBSD.org>2005-03-10 16:27:39 +0000
committerVolker Stolz <vs@FreeBSD.org>2005-03-10 16:27:39 +0000
commitc9c05d2623a691cce89d20d3633cd9e382ce7170 (patch)
tree3cda9b671a3b2e0ecbf9aa77a336260ec79cf6bb /net-im/jabber
parent15e9280a69341d7cbf3449a440de2dfb3a4d818d (diff)
downloadports-c9c05d2623a691cce89d20d3633cd9e382ce7170.tar.gz
ports-c9c05d2623a691cce89d20d3633cd9e382ce7170.zip
- 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
Notes
Notes: svn path=/head/; revision=130815
Diffstat (limited to 'net-im/jabber')
-rw-r--r--net-im/jabber/Makefile3
-rw-r--r--net-im/jabber/files/jabberd.sh63
-rw-r--r--net-im/jabber/files/patch-jabber.xml2
3 files changed, 33 insertions, 35 deletions
diff --git a/net-im/jabber/Makefile b/net-im/jabber/Makefile
index a3431e6adfa7..16dfbd722d0b 100644
--- a/net-im/jabber/Makefile
+++ b/net-im/jabber/Makefile
@@ -19,6 +19,7 @@ COMMENT= Online presence and instant messaging server
LIB_DEPENDS= pth.20:${PORTSDIR}/devel/pth \
expat.5:${PORTSDIR}/textproc/expat2
+USE_RC_SUBR= yes
USE_BZIP2= yes
GNU_CONFIGURE= yes
USE_GMAKE= yes
@@ -45,6 +46,6 @@ post-configure:
post-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- ${INSTALL_DATA} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
+ ${INSTALL_SCRIPT} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
.include <bsd.port.mk>
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.
-->
- <pidfile>./jabber.pid</pidfile>
-+ <pidfile>/var/tmp/jabber.pid</pidfile>
++ <pidfile>/var/spool/jabber/jabber.pid</pidfile>
</jabber>