Contents of /trunk/syslog-ng/syslog-ng.rc
Parent Directory | Revision Log
Revision 1040 -
(show annotations)
(download)
Wed May 5 13:53:35 2010 UTC (14 years, 6 months ago) by niro
File size: 1256 byte(s)
Wed May 5 13:53:35 2010 UTC (14 years, 6 months ago) by niro
File size: 1256 byte(s)
- no quiet, tell start-stop-daemon where the pidfile is - style updates
1 | #!/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/conf.d/rc |
13 | source $rc_functions |
14 | |
15 | die() |
16 | { |
17 | echo "Error: $@" |
18 | exit 1 |
19 | } |
20 | |
21 | |
22 | checkconfig() |
23 | { |
24 | if [ ! -e /etc/syslog-ng/syslog-ng.conf ] |
25 | then |
26 | die "You need to create /etc/syslog-ng/syslog-ng.conf first." |
27 | fi |
28 | syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf || \ |
29 | die "Configuration error. Please fix your configfile (/etc/syslog-ng/syslog-ng.conf)" |
30 | } |
31 | |
32 | |
33 | case "$1" in |
34 | start) |
35 | checkconfig || exit 1 |
36 | |
37 | echo -e ${COLOREDSTAR}"Starting syslog-ng daemon ..." |
38 | start-stop-daemon --start --pidfile /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng |
39 | evaluate_retval |
40 | |
41 | update_svcstatus $1 |
42 | splash svc_started "$(basename $0)" 0 |
43 | ;; |
44 | |
45 | stop) |
46 | echo -e ${COLOREDSTAR}"Stopping syslog-ng daemon ..." |
47 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid |
48 | evaluate_retval |
49 | |
50 | update_svcstatus $1 |
51 | splash svc_stopped "$(basename $0)" 0 |
52 | ;; |
53 | |
54 | reload) |
55 | checkconfig || exit 1 |
56 | echo -e ${COLOREDSTAR}"Reloading syslog-ng daemon ..." |
57 | reloadproc /usr/sbin/syslog-ng |
58 | ;; |
59 | |
60 | restart) |
61 | $0 stop |
62 | sleep 1 |
63 | $0 start |
64 | ;; |
65 | |
66 | status) |
67 | statusproc syslog-ng |
68 | ;; |
69 | |
70 | *) |
71 | echo "Usage: $0 {start|stop|reload|restart|status}" |
72 | exit 1 |
73 | ;; |
74 | esac |