3 # syslog Starts syslog-ng (syslogd replacement).
5 # chkconfig: 2345 17 83
6 # description: Syslog is the facility by which many daemons use to log \
7 # messages to various system log files. It is a good idea to \
10 # Source function library
11 . /etc/rc.d/init.d/functions
14 if [ -f /etc/sysconfig/syslog-ng ]; then
15 . /etc/sysconfig/syslog-ng
19 # must return non-zero if check failed
20 # output is discarded if checkconfig is ran without details
22 syslog-ng $OPTIONS -F -s -p /var/run/syslog-ng-syntaxcheck.pid
26 # wrapper for configtest
30 if [ $details = 1 ]; then
31 # run config test and display report (status action)
32 show "Checking %s configuration" "syslog-ng"; busy
34 out=$(configtest 2>&1)
36 if [ $RETVAL = 0 ]; then
41 [ "$out" ] && echo >&2 "$out"
43 # run config test and abort with nice message if failed
44 # (for actions checking status before action).
45 configtest >/dev/null 2>&1
47 if [ $RETVAL != 0 ]; then
48 show "Checking %s configuration" "syslog-ng"; fail
49 nls 'Configuration test failed. See details with %s "checkconfig"' $0
56 # Check if the service is already running?
57 if [ -f /var/lock/subsys/syslog-ng ]; then
58 msg_already_running "syslog-ng"
62 msg_starting "syslog-ng"
63 daemon @@SBINDIR@@/syslog-ng -f /etc/syslog-ng/syslog-ng.conf --worker-threads=1024 $OPTIONS
65 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog-ng
69 if [ ! -f /var/lock/subsys/syslog-ng ]; then
70 msg_not_running "syslog-ng"
74 msg_stopping "syslog-ng"
76 rm -f /var/lock/subsys/syslog-ng >/dev/null 2>&1
80 if [ ! -f /var/lock/subsys/syslog-ng ]; then
81 msg_not_running "syslog-ng"
92 if [ ! -f /var/lock/subsys/syslog-ng ]; then
93 msg_not_running "syslog-ng"
99 msg_reloading "syslog-ng"
100 killproc syslog-ng -HUP
105 if [ -f /var/lock/subsys/syslog-ng ]; then
107 msg_reloading "syslog-ng"
108 killproc syslog-ng -HUP
111 msg_not_running "syslog-ng"
117 # See how we were called.
140 checkconfig|configtest)
148 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status|checkconfig|flush-logs}"