public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-im/jabberd2/files: jabberd2-2.3.2.init jabberd2-2.3.2.logrotate
@ 2014-06-01 20:09 Julian Ospald (hasufell)
  0 siblings, 0 replies; only message in thread
From: Julian Ospald (hasufell) @ 2014-06-01 20:09 UTC (permalink / raw
  To: gentoo-commits

hasufell    14/06/01 20:09:54

  Added:                jabberd2-2.3.2.init jabberd2-2.3.2.logrotate
  Log:
  fix logroate script wrt #505596
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key BDEED020)

Revision  Changes    Path
1.1                  net-im/jabberd2/files/jabberd2-2.3.2.init

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.2.init?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.2.init?rev=1.1&content-type=text/plain

Index: jabberd2-2.3.2.init
===================================================================
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.2.init,v 1.1 2014/06/01 20:09:54 hasufell Exp $

extra_commands="reload"

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 executable cfgfile pidfile
	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})"
		pidfile="$(grep -v ^# ${cfgfile} | grep '<pidfile>' | sed 's#<.\?pidfile>##g')"
		start-stop-daemon \
			--background \
			--start  \
			--user jabber:jabber \
			--exec /usr/bin/${service} \
			--pid ${pidfile} \
			-- -c ${cfgfile}
		eend $?

	done
	eoutdent

}

reload() {
	eindent
	for pidfile in /var/run/jabber/*.pid; do
		if [ -f "${pidfile}" ]; then
			service=$(basename ${pidfile} .pid)
			ebegin "Reloading ${service}"
			kill -HUP $(cat ${pidfile})
			eend $?
		fi
	done
 	eoutdent
}

stop() {

	einfo "Stopping Jabber Server"
	stopJabberServices

}



1.1                  net-im/jabberd2/files/jabberd2-2.3.2.logrotate

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.2.logrotate?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.2.logrotate?rev=1.1&content-type=text/plain

Index: jabberd2-2.3.2.logrotate
===================================================================
/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
	/etc/init.d/jabberd reload
	endscript
}





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-01 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-01 20:09 [gentoo-commits] gentoo-x86 commit in net-im/jabberd2/files: jabberd2-2.3.2.init jabberd2-2.3.2.logrotate Julian Ospald (hasufell)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox