desktop/rsyslog/rsyslog
2016-03-25 19:43:07 +01:00

40 lines
710 B
Bash

#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/rsyslog
PID=`pidof -o %PPID /usr/sbin/rsyslogd`
case "$1" in
start)
stat_busy "Starting RSyslogd"
[ -z "$PID" ] && /usr/sbin/rsyslogd $RSYSLOGD_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon rsyslogd
stat_done
fi
;;
stop)
stat_busy "Stopping RSyslogd"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm -f /var/run/rsyslogd.pid
rm -f /var/rsyslogd.persist
rm_daemon rsyslogd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0