Annotation of /trunk/syslog-ng/syslog-ng.rc
Parent Directory | Revision Log
Revision 271 -
(hide annotations)
(download)
Sat Jul 21 18:01:45 2007 UTC (17 years, 3 months ago) by niro
File size: 1226 byte(s)
Sat Jul 21 18:01:45 2007 UTC (17 years, 3 months ago) by niro
File size: 1226 byte(s)
-fixed a typo
1 | niro | 153 | #!/bin/bash |
2 | |||
3 | #%rlevels: 0:k 1:k 2:k 3:s 4:s 5:s 6:k | ||
4 | #%start: 10 | ||
5 | #%stop: 20 | ||
6 | |||
7 | #deps | ||
8 | #%needs: | ||
9 | #%before: | ||
10 | #%after: | ||
11 | |||
12 | source /etc/sysconfig/rc | ||
13 | source $rc_functions | ||
14 | |||
15 | die() { | ||
16 | echo "Error: $@" | ||
17 | exit 1 | ||
18 | } | ||
19 | |||
20 | |||
21 | checkconfig() { | ||
22 | if [ ! -e /etc/syslog-ng/syslog-ng.conf ] | ||
23 | then | ||
24 | die "You need to create /etc/syslog-ng/syslog-ng.conf first." | ||
25 | fi | ||
26 | syslog-ng -s /etc/syslog-ng/syslog-ng.conf || \ | ||
27 | die "Configuration error. Please fix your configfile (/etc/syslog-ng/syslog-ng.conf)" | ||
28 | } | ||
29 | |||
30 | |||
31 | case "$1" in | ||
32 | start) | ||
33 | checkconfig || exit 1 | ||
34 | |||
35 | echo -e ${COLOREDSTAR}"Starting syslog-ng daemon ..." | ||
36 | start-stop-daemon --start --quiet --exec /usr/sbin/syslog-ng | ||
37 | evaluate_retval | ||
38 | |||
39 | update_svcstatus $1 | ||
40 | splash svc_started "$(basename $0)" 0 | ||
41 | ;; | ||
42 | |||
43 | stop) | ||
44 | echo -e ${COLOREDSTAR}"Stopping syslog-ng daemon ..." | ||
45 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
46 | evaluate_retval | ||
47 | |||
48 | update_svcstatus $1 | ||
49 | splash svc_stopped "$(basename $0)" 0 | ||
50 | |||
51 | ;; | ||
52 | |||
53 | reload) | ||
54 | checkconfig || exit 1 | ||
55 | echo -e ${COLOREDSTAR}"Reloading syslog-ng daemon ..." | ||
56 | reloadproc /usr/sbin/syslog-ng | ||
57 | ;; | ||
58 | |||
59 | restart) | ||
60 | $0 stop | ||
61 | sleep 1 | ||
62 | $0 start | ||
63 | ;; | ||
64 | |||
65 | status) | ||
66 | niro | 271 | statusproc syslog-ng |
67 | niro | 153 | ;; |
68 | |||
69 | *) | ||
70 | echo "Usage: $0 {start|stop|restart|status}" | ||
71 | exit 1 | ||
72 | ;; | ||
73 | esac | ||
74 |