diff options
author | Julian Ospald <hasufell@gentoo.org> | 2013-11-01 21:50:27 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2013-11-01 21:50:27 +0000 |
commit | b705d1c741a5c1204de813f95a2e1febd61f71db (patch) | |
tree | d3e28e8661539de5effee355e59c93f07344bb8b /net-im/jabberd2/files | |
parent | Stable for alpha, wrt bug #488630 (diff) | |
download | historical-b705d1c741a5c1204de813f95a2e1febd61f71db.tar.gz historical-b705d1c741a5c1204de813f95a2e1febd61f71db.tar.bz2 historical-b705d1c741a5c1204de813f95a2e1febd61f71db.zip |
version bump wrt #314473 and #432936
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Manifest-Sign-Key: 0xE73C35B3
Diffstat (limited to 'net-im/jabberd2/files')
-rw-r--r-- | net-im/jabberd2/files/jabberd2-2.2.17.init | 81 | ||||
-rw-r--r-- | net-im/jabberd2/files/jabberd2-2.2.17.logrotate | 10 |
2 files changed, 91 insertions, 0 deletions
diff --git a/net-im/jabberd2/files/jabberd2-2.2.17.init b/net-im/jabberd2/files/jabberd2-2.2.17.init new file mode 100644 index 000000000000..32cb1777dd60 --- /dev/null +++ b/net-im/jabberd2/files/jabberd2-2.2.17.init @@ -0,0 +1,81 @@ +#!/sbin/runscript +# Copyright 1999-2013 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.17.init,v 1.1 2013/11/01 21:50:22 hasufell 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_pre() { + checkpath -d -o jabber /var/run/jabber +} + +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 \ + --user 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 + +} diff --git a/net-im/jabberd2/files/jabberd2-2.2.17.logrotate b/net-im/jabberd2/files/jabberd2-2.2.17.logrotate new file mode 100644 index 000000000000..0ce109263fbe --- /dev/null +++ b/net-im/jabberd2/files/jabberd2-2.2.17.logrotate @@ -0,0 +1,10 @@ +/var/log/jabber/c2s.log /var/log/jabber/s2s.log /var/log/jabber/sm.log /var/log/jabber/router.log { + su jabber jabber + sharedscripts + postrotate + kill -HUP $(cat /var/run/jabberd/c2s.pid) + kill -HUP $(cat /var/run/jabberd/s2s.pid) + kill -HUP $(cat /var/run/jabberd/sm.pid) + kill -HUP $(cat /var/run/jabberd/router.pid) + endscript +} |