summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Anderson <tanderson@gentoo.org>2008-09-15 01:33:55 +0000
committerThomas Anderson <tanderson@gentoo.org>2008-09-15 01:33:55 +0000
commit6f36ec678edfa9aed11255d178f20182e91a49e0 (patch)
tree795d7067d2cad3a1289cd96eda01b62468c3c985 /net-im/jabberd2/files/jabberd2-2.2.4.init
parent(#237411) Add VIDEO_CARDS=ast to IUSE. (diff)
downloadhistorical-6f36ec678edfa9aed11255d178f20182e91a49e0.tar.gz
historical-6f36ec678edfa9aed11255d178f20182e91a49e0.tar.bz2
historical-6f36ec678edfa9aed11255d178f20182e91a49e0.zip
Version bump, bug #236710
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'net-im/jabberd2/files/jabberd2-2.2.4.init')
-rw-r--r--net-im/jabberd2/files/jabberd2-2.2.4.init77
1 files changed, 77 insertions, 0 deletions
diff --git a/net-im/jabberd2/files/jabberd2-2.2.4.init b/net-im/jabberd2/files/jabberd2-2.2.4.init
new file mode 100644
index 000000000000..8d40b606428b
--- /dev/null
+++ b/net-im/jabberd2/files/jabberd2-2.2.4.init
@@ -0,0 +1,77 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/jabberd2/files/jabberd2-2.2.4.init,v 1.1 2008/09/15 01:33:55 gentoofan23 Exp $
+
+depend() {
+ need net
+ use mysql postgresql slapd
+ provide jabber-server
+}
+
+stopJabberServices() {
+
+ eindent
+ for pidfile in /var/run/jabber/*.pid; do
+ if [ -f "${pidfile}" ]; then
+ service=$(basename ${pidfile} .pid)
+ ebegin "Stopping ${service}"
+ start-stop-daemon \
+ --stop \
+ --pidfile ${pidfile}
+ eend $?
+ fi
+ done
+ eoutdent
+
+}
+
+start() {
+
+ einfo "Starting Jabber Server ..."
+ local services
+ services=$(grep -v ^# /etc/jabber/jabberd.cfg | grep '..*' | awk '{print $1 ":" $2}')
+ eindent
+ for service in ${services}; do
+
+ cfgfile=$(echo ${service} | cut -d ':' -f 2)
+ service=$(echo ${service} | cut -d ':' -f 1)
+ if [ ! -f "${cfgfile}" ]; then
+ if [ -f "/etc/jabber/${service}.xml" ]; then
+ cfgfile="/etc/jabber/${service}.xml"
+ else
+ eerror "Can't find: ${cfgfile} or default /etc/jabber/${service}.xml"
+ stopJabberServices
+ return 1
+ fi
+ fi
+
+ executable=/usr/bin/${service}
+
+ if [ ! -f "${executable}" ]; then
+ eerror "Can't find executable: ${executable}"
+ stopJabberServices
+ return 1
+ fi
+
+ ebegin "Starting ${service} (${cfgfile})"
+ start-stop-daemon \
+ --background \
+ --start \
+ --chuid jabber:jabber \
+ --exec /usr/bin/${service} \
+ --pid /var/run/jabber/$(basename ${cfgfile%.xml}).pid \
+ -- -c ${cfgfile}
+ eend $?
+
+ done
+ eoutdent
+
+}
+
+stop() {
+
+ einfo "Stopping Jabber Server"
+ stopJabberServices
+
+}