net-im/xib-bot/files/xib-bot.initd
changeset 117 0cb2ee2d7365
parent 1 af44598ccbe3
equal deleted inserted replaced
111:5992b254421e 117:0cb2ee2d7365
     2 # Copyright 1999-2010 Gentoo Foundation
     2 # Copyright 1999-2010 Gentoo Foundation
     3 # Distributed under the terms of the GNU General Public License v2
     3 # Distributed under the terms of the GNU General Public License v2
     4 # $Header: $
     4 # $Header: $
     5 
     5 
     6 PIDFILE=${PIDFILE:=/var/run/xib-bot.pid}
     6 PIDFILE=${PIDFILE:=/var/run/xib-bot.pid}
     7 CONF=${CONF:=/usr/share/xib-bot/config.xml}
     7 CONF=${CONF:=/etc/xib-bot/config.xml}
     8 LOGFILE=${LOGFILE:=/var/log/xib-bot.log}
     8 LOGFILE=${LOGFILE:=/var/log/xib-bot.log}
       
     9 STARTFILE={STARTFILE:=/usr/lib/python2.7/site-package/xib-bot/start_bots_from_xml_config.py}
     9 
    10 
    10 depend() {
    11 depend() {
    11 	need net
    12 	need net
    12 }
    13 }
    13 
    14 
    14 start() {
    15 start() {
    15 	ebegin "Starting ${SVCNAME}"
    16 	ebegin "Starting ${SVCNAME}"
    16 	start-stop-daemon --start --exec /usr/share/xib-bot/start_bots_from_xml_config.py \
    17 	start-stop-daemon --start --exec "$STARTFILE" \
    17 		-1 ${LOGFILE} -2 ${LOGFILE} \
    18 		-1 ${LOGFILE} -2 ${LOGFILE} \
    18 		-m --pidfile "${PIDFILE}" -b -- "${CONF}"
    19 		-m --pidfile "${PIDFILE}" -b -- "${CONF}"
    19 	eend $?
    20 	eend $?
    20 }
    21 }
    21 
    22 
    22 stop() {
    23 stop() {
    23 	ebegin "Stopping ${SVCNAME}"
    24 	ebegin "Stopping ${SVCNAME}"
    24 	start-stop-daemon --stop --exec /usr/share/xib-bot/start_bots_from_xml_config.py \
    25 	start-stop-daemon --stop --exec  "$STARTFILE" \
    25 		--pidfile "${PIDFILE}"
    26 		--pidfile "${PIDFILE}"
    26 }
    27 }
    27 
    28