2016-11-26 03:18:09 +03:00
|
|
|
#!/sbin/openrc-run
|
2014-05-03 22:56:29 +04:00
|
|
|
# Copyright 1999-2012 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: $
|
|
|
|
|
|
|
|
LOGFILE=/var/log/spectrum2/std.log
|
2016-11-26 03:54:52 +03:00
|
|
|
piddir=${pid_dir:-/var/run/spectrum2}
|
2014-05-03 22:56:29 +04:00
|
|
|
|
|
|
|
depend() {
|
2016-11-26 03:49:31 +03:00
|
|
|
need net
|
|
|
|
use jabber-server
|
2014-05-03 22:56:29 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2016-11-26 03:49:31 +03:00
|
|
|
ebegin "Starting ${PROTOCOL} Spectrum Transport"
|
|
|
|
if [ ! -d ${piddir} ]; then
|
|
|
|
checkpath -q -d -o jabber:jabber -m 0755 ${piddir} || return
|
|
|
|
fi
|
|
|
|
start-stop-daemon --start --user jabber --group jabber \
|
2014-05-03 22:56:29 +04:00
|
|
|
--exec /usr/bin/spectrum2_manager start &> $LOGFILE
|
2016-11-26 03:49:31 +03:00
|
|
|
eend $?
|
2014-05-03 22:56:29 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2016-11-26 03:49:31 +03:00
|
|
|
ebegin "Stopping ${PROTOCOL} Spectrum Transport"
|
|
|
|
start-stop-daemon --user jabber --group jabber \
|
2014-05-03 22:56:29 +04:00
|
|
|
--exec /usr/bin/spectrum2_manager stop 1>>$LOGFILE 2>&1
|
2016-11-26 03:49:31 +03:00
|
|
|
eend $?
|
2014-05-03 22:56:29 +04:00
|
|
|
}
|
2016-11-26 03:18:09 +03:00
|
|
|
|
|
|
|
status() {
|
|
|
|
local _retval
|
|
|
|
einfon ""
|
|
|
|
/usr/bin/spectrum2_manager status &> /dev/null
|
|
|
|
_retval=$?
|
|
|
|
if [ x${_retval} = 'x0' ]; then
|
|
|
|
mark_service_started "${SVCNAME}"
|
|
|
|
eend 0
|
|
|
|
else
|
|
|
|
mark_service_stopped "${SVCNAME}"
|
|
|
|
eend 3
|
|
|
|
fi
|
|
|
|
}
|