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

Contents of /cauldron/abrt/pristine/SOURCES/abrt.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138580 - (show annotations) (download)
Mon Sep 5 01:20:23 2011 UTC (9 years, 4 months ago) by schedbot
File size: 1709 byte(s)
Copying release 2.0.2-5.mga2 to pristine/ directory.
1 #!/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 to and dispatch crash events
15 ### END INIT INFO
16
17 # Source function library.
18 . /etc/rc.d/init.d/functions
19 ABRT_BIN="/usr/sbin/abrtd"
20 LOCK="/var/lock/subsys/abrtd"
21 OLD_LOCK="/var/lock/subsys/abrt"
22 RETVAL=0
23
24 #
25 # Set these variables if you are behind proxy
26 #
27 #export http_proxy=
28 #export https_proxy=
29
30 #
31 # See how we were called.
32 #
33
34 check() {
35 # Check that we're a privileged user
36 [ "`id -u`" = 0 ] || exit 4
37
38 # Check if abrt is executable
39 test -x $ABRT_BIN || exit 5
40 }
41
42 start() {
43
44 check
45
46 # Check if it is already running
47 if [ ! -f $LOCK ] && [ ! -f $OLD_LOCK ]; then
48 echo -n $"Starting abrt daemon: "
49 daemon $ABRT_BIN
50 RETVAL=$?
51 [ $RETVAL -eq 0 ] && touch $LOCK
52 echo
53 fi
54 return $RETVAL
55 }
56
57 stop() {
58
59 check
60
61 echo -n $"Stopping abrt daemon: "
62 killproc $ABRT_BIN
63 RETVAL=$?
64 [ $RETVAL -eq 0 ] && rm -f $LOCK
65 [ $RETVAL -eq 0 ] && rm -f $OLD_LOCK
66 echo
67 return $RETVAL
68 }
69
70
71 restart() {
72 stop
73 start
74 }
75
76 reload() {
77 restart
78 }
79
80 case "$1" in
81 start)
82 start
83 ;;
84 stop)
85 stop
86 ;;
87 reload)
88 reload
89 ;;
90 force-reload)
91 echo "$0: Unimplemented feature."
92 RETVAL=3
93 ;;
94 restart)
95 restart
96 ;;
97 condrestart)
98 if [ -f $LOCK ]; then
99 restart
100 fi
101 # update from older version
102 if [ -f $OLD_LOCK ]; then
103 restart
104 fi
105 ;;
106 status)
107 status abrtd
108 RETVAL=$?
109 ;;
110 *)
111 echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
112 RETVAL=2
113 esac
114
115 exit $RETVAL
116

  ViewVC Help
Powered by ViewVC 1.1.28