aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorvs <vs@FreeBSD.org>2005-03-11 00:27:39 +0800
committervs <vs@FreeBSD.org>2005-03-11 00:27:39 +0800
commit034cb862232bdfddd7bb607018f7d3a96db1c411 (patch)
treebb9b301eb38a8cd7e66ffb6c78105b476849e276 /net
parentfa30d9ac00317ac8e72fb1db0ddbbfc95b9c4292 (diff)
downloadfreebsd-ports-gnome-034cb862232bdfddd7bb607018f7d3a96db1c411.tar.gz
freebsd-ports-gnome-034cb862232bdfddd7bb607018f7d3a96db1c411.tar.zst
freebsd-ports-gnome-034cb862232bdfddd7bb607018f7d3a96db1c411.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
Diffstat (limited to 'net')
-rw-r--r--net/jabber/Makefile3
-rw-r--r--net/jabber/files/jabberd.sh63
-rw-r--r--net/jabber/files/patch-jabber.xml2
3 files changed, 33 insertions, 35 deletions
diff --git a/net/jabber/Makefile b/net/jabber/Makefile
index a3431e6adfa7..16dfbd722d0b 100644
--- a/net/jabber/Makefile
+++ b/net/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/jabber/files/jabberd.sh b/net/jabber/files/jabberd.sh
index 109855681eff..d0facc8f5257 100644
--- a/net/jabber/files/jabberd.sh
+++ b/net/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/jabber/files/patch-jabber.xml b/net/jabber/files/patch-jabber.xml
index 378893a1aea6..925184122ed1 100644
--- a/net/jabber/files/patch-jabber.xml
+++ b/net/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>