2011-06-29 15:46:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
start() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Starting rsyslog daemon: "
|
2015-01-14 00:16:59 +01:00
|
|
|
start-stop-daemon -S -q -p /var/run/rsyslogd.pid --exec /usr/sbin/rsyslogd
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2011-06-29 15:46:21 +02:00
|
|
|
}
|
2015-01-14 00:16:59 +01:00
|
|
|
|
2011-06-29 15:46:21 +02:00
|
|
|
stop() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Stopping rsyslog daemon: "
|
2015-01-14 00:16:59 +01:00
|
|
|
start-stop-daemon -K -q -p /var/run/rsyslogd.pid
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2011-06-29 15:46:21 +02:00
|
|
|
}
|
2015-01-14 00:16:59 +01:00
|
|
|
|
2011-06-29 15:46:21 +02:00
|
|
|
restart() {
|
2015-01-14 00:16:59 +01:00
|
|
|
stop
|
|
|
|
sleep 1
|
|
|
|
start
|
2011-06-29 15:46:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2015-01-14 00:16:59 +01:00
|
|
|
start
|
|
|
|
;;
|
2011-06-29 15:46:21 +02:00
|
|
|
stop)
|
2015-01-14 00:16:59 +01:00
|
|
|
stop
|
|
|
|
;;
|
2011-06-29 15:46:21 +02:00
|
|
|
restart|reload)
|
2015-01-14 00:16:59 +01:00
|
|
|
restart
|
|
|
|
;;
|
2011-06-29 15:46:21 +02:00
|
|
|
*)
|
2015-01-14 00:16:59 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
exit 1
|
2011-06-29 15:46:21 +02:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|