]>
Commit | Line | Data |
---|---|---|
8438c275 | 1 | #!/bin/sh |
2 | # | |
3 | # syslog Starts syslog-nd (syslogd replacment). | |
4 | # | |
5 | # | |
6 | # chkconfig: 2345 30 70 | |
7 | # description: Syslog is the facility by which many daemons use to log \ | |
8 | # messages to various system log files. It is a good idea to \ | |
9 | # always run syslog. | |
10 | ||
11 | # Source function library | |
12 | . /etc/rc.d/init.d/functions | |
13 | ||
14 | # Get network config | |
15 | . /etc/sysconfig/network | |
16 | ||
17 | # Set defaults | |
18 | ENABLE_RECEIVE_FROM_NET=no | |
19 | HOSTLIST="" | |
20 | DOMAINLIST="" | |
21 | MARK_TIMESTAMP="" | |
22 | ||
23 | [ -f /usr/sbin/syslog-ng ] || exit 0 | |
24 | [ -f /etc/syslog-ng/syslog-ng.conf ] || exit 0 | |
25 | ||
26 | # Get service config | |
27 | if [ -f /etc/sysconfig/syslog-ng ] ; then | |
28 | . /etc/sysconfig/syslog-ng | |
29 | fi | |
30 | ||
31 | # See how we were called. | |
32 | case "$1" in | |
33 | start) | |
34 | # Check if the service is already running? | |
35 | if [ ! -f /var/lock/subsys/syslog ]; then | |
36 | show Starting system loggers | |
37 | daemon syslogd-ng $OPTIONS | |
38 | touch /var/lock/subsys/syslog | |
39 | else | |
40 | echo "system loggers already are running" | |
41 | fi | |
42 | ;; | |
43 | stop) | |
44 | show Stopping system loggers | |
45 | rm -f /var/lock/subsys/syslog | |
46 | ;; | |
47 | status) | |
48 | status syslogd | |
49 | ;; | |
50 | restart|reload) | |
51 | $0 stop | |
52 | $0 start | |
53 | ;; | |
54 | *) | |
55 | echo "Usage: $0 {start|stop|status|restart|reload}" | |
56 | exit 1 | |
57 | esac | |
58 | ||
59 | exit 0 |