]> git.pld-linux.org Git - packages/argus.git/blob - argus.init
- logrotate 3.8.0 requires "su" option for non-root writable dirs
[packages/argus.git] / argus.init
1 #!/bin/sh
2 # Startup script for argus
3 #
4 # chkconfig: 2345 97 03
5 # description: Run argus
6
7 # Source function library.
8 . /etc/rc.d/init.d/functions
9
10 # Get network config
11 . /etc/sysconfig/network
12
13 # Get service config
14 [ -f /etc/sysconfig/argus ] && . /etc/sysconfig/argus
15
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down argus
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 start() {
27         if [ ! -f /var/lock/subsys/argus ]; then
28                 msg_starting argus
29                 daemon argus -d "${LOG}" "${USER}"
30                 RETVAL=$?
31                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/argus
32         else
33                 msg_already_running argus
34         fi
35 }
36
37 stop() {
38         if [ -f /var/lock/subsys/argus ]; then
39                 msg_stopping argus
40                 killproc argus
41                 rm -f /var/lock/subsys/argus
42         else
43                 msg_not_running argus
44                 RETVAL=7
45         fi
46 }
47
48 reload() {
49         if [ -f /var/lock/subsys/argus ]; then
50                 msg_reloading argus
51                 killproc argus -HUP
52                 RETVAL=$?
53         else
54                 msg_not_running argus
55                 RETVAL=7
56         fi
57 }
58
59 RETVAL=0
60 # See how we were called.
61 case "$1" in
62   start)
63         start
64         ;;
65
66   stop)
67         stop
68         ;;
69
70   restart)
71         stop
72         start
73         ;;
74
75   reload|force-reload)
76         reload
77         ;;
78
79   status)
80         status argus
81         RETVAL=$?
82         ;;
83
84   *)
85         msg_usage "$0 {start|stop|reload|force-reload|status}"
86         exit 3
87 esac
88
89 exit $RETVAL
This page took 0.087745 seconds and 3 git commands to generate.