/[packages]/cauldron/abrt/current/SOURCES/abrt.init
ViewVC logotype

Annotation of /cauldron/abrt/current/SOURCES/abrt.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21273 - (hide annotations) (download)
Mon Jan 17 13:41:48 2011 UTC (10 years, 8 months ago) by blino
File size: 1480 byte(s)
imported package abrt
1 blino 21273 #!/bin/bash
2     # Starts the abrt daemon
3     #
4     # chkconfig: 35 82 16
5     # description: Daemon to detect crashing apps
6     # processname: abrtd
7     ### BEGIN INIT INFO
8     # Provides: abrt
9     # Required-Start: $syslog $local_fs
10     # Required-Stop: $syslog $local_fs
11     # Default-Stop: 0 1 2 6
12     # Default-Start: 3 5
13     # Short-Description: start and stop abrt daemon
14     # Description: Listen and dispatch crash events
15     ### END INIT INFO
16    
17     # Source function library.
18     . /etc/rc.d/init.d/functions
19    
20     RETVAL=0
21    
22     #
23     # See how we were called.
24     #
25    
26     check() {
27     # Check that we're a privileged user
28     [ `id -u` = 0 ] || exit 4
29    
30     # Check if abrt is executable
31     test -x /usr/sbin/abrtd || exit 5
32     }
33    
34     start() {
35    
36     check
37    
38     # Check if it is already running
39     if [ ! -f /var/lock/subsys/abrtd ]; then
40     echo -n $"Starting abrt daemon: "
41     daemon /usr/sbin/abrtd
42     RETVAL=$?
43     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/abrtd
44     echo
45     fi
46     return $RETVAL
47     }
48    
49     stop() {
50    
51     check
52    
53     echo -n $"Stopping abrt daemon: "
54     killproc /usr/sbin/abrtd
55     RETVAL=$?
56     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/abrtd
57     echo
58     return $RETVAL
59     }
60    
61    
62     restart() {
63     stop
64     start
65     }
66    
67     reload() {
68     restart
69     }
70    
71     case "$1" in
72     start)
73     start
74     ;;
75     stop)
76     stop
77     ;;
78     reload)
79     reload
80     ;;
81     force-reload)
82     echo "$0: Unimplemented feature."
83     RETVAL=3
84     ;;
85     restart)
86     restart
87     ;;
88     condrestart)
89     if [ -f /var/lock/subsys/abrtd ]; then
90     restart
91     fi
92     ;;
93     status)
94     status abrt
95     RETVAL=$?
96     ;;
97     *)
98     echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
99     RETVAL=2
100     esac
101    
102     exit $RETVAL

  ViewVC Help
Powered by ViewVC 1.1.28