File nxlog-ce.init of Package nxlog-ce
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: syslog
# Required-Start: network $remote_fs
# Should-Start: earlysyslog
# Required-Stop: network
# Should-Stop: earlysyslog
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Start the system logging daemons
# Description: Start the system logging daemons
### END INIT INFO
NXLOG_CE=/usr/bin/nxlog
NXLOG_CE_USER=nxlog
test -x $NXLOG_CE || { echo "$NXLOG_CE not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
NXLOG_CE_CONF=/etc/nxlog/nxlog.conf
test -r $NXLOG_CE_CONF || { echo "$NXLOG_CE_CONF not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting nxlog (syslog)"
$NXLOG_CE
rc_status -v
;;
stop)
echo -n "Shutting down nxlog (syslog)"
$NXLOG_CE -s
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
echo -n "Reload service nxlog (syslog)"
$NXLOG_CE -r
rc_status -v
;;
status)
echo -n "Checking for service nxlog (syslog)"
/sbin/checkproc $NXLOG_CE
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
rc_exit