git.schokokeks.org
Repositories
Help
Report an Issue
keks-overlay.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
8c4e5b8
Branches
Tags
master
keks-overlay.git
net-im
jabberd
files
jabber.init.gentoo
A keks * initial commit
Lars Strojny
commited
8c4e5b8
at 2006-12-17 11:28:02
jabber.init.gentoo
Blame
History
Raw
#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-im/jabberd/files/jabber.init.gentoo,v 1.1 2005/01/31 23:05:41 humpback Exp $ depend() { need net use mysql postgresql slapd provide jabber-server } components="router resolver sm c2s s2s" my_start() { ebegin "-> Starting ${i}" component=${i} # pidfile=/var/jabberd/pid/${component}.pid # ## remove components pidfile # rm -f "${pidfile}" >/dev/null 2>&1 ## start component start-stop-daemon --start -c jabber:jabber -b \ -q -x /usr/bin/${component} >/dev/null 2>&1 # ## check if pidfile exists # if [ ! -f "${pidfile}" ]; then # false # ## check if pidfile contains the pid of a running process # elif ! ps -p "$(< ${pidfile})" -o pid= >/dev/null 2>&1; then # false # fi eend $? } my_stop() { ebegin "-> Stopping ${i}" component=${i} pidfile=/var/jabberd/pid/${component}.pid start-stop-daemon --stop -q --pidfile ${pidfile} >/dev/null 2>&1 # if [ -f "${pidfile}" ] && ps -p "$(< ${pidfile})" -o pid= >/dev/null 2>&1; then # false # fi # ## remove components pidfile # rm -f "${pidfile}" >/dev/null 2>&1 eend $? } start() { ebegin "Starting Jabber Server" local started='' local failed='' for i in ${components}; do if ! my_start ${i}; then failed="${failed:+${failed} }${i}" else started="${started:+${started} }${i}" fi done if [ -n "${failed}" ]; then eerror eerror "The following components failed to start:" eerror "-> ${failed}" eerror eerror "Trying to stop started components" for i in ${started}; do my_stop ${i} done false fi eend $? } stop() { ebegin "Stopping Jabber Server" local failed='' for i in ${components}; do if ! my_stop ${i}; then failed="${failed:+${failed} }${i}" fi done if [ -n "${failed}" ]; then eerror eerror "The following components failed to stop:" eerror "-> ${failed}" eerror eerror "Please kill the processes manually and reset" eerror "this service to a stopped state using" eerror "-> ${0} zap" eerror false fi eend $? }