Migrated vivivi service from init.d to systemd.
This commit is contained in:
parent
d59a3b8c46
commit
4ee3c8003a
48
vivivi.initd
48
vivivi.initd
@ -1,48 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: vivivi
|
||||
# Required-Start: $remote_fs $syslog $local_fs $network
|
||||
# Required-Stop: $remote_fs $syslog $local_fs $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Bot irc de l'April.
|
||||
# Description: vivivi est un bot irc, il est ici pout avertir des alertes icinga
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DAEMON=/srv/nagios-irc-bot/bot.sh
|
||||
NAME=vivivi
|
||||
DESC=vivivi
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$NAME.pid \
|
||||
--chuid nagios --exec $DAEMON -- --daemon $DAEMON \
|
||||
|| return 2
|
||||
echo "$NAME."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: "
|
||||
rm -f /var/run/$NAME.pid
|
||||
pkill -9 -f nagios-irc-bot.pl
|
||||
echo "$NAME."
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user