2 # Starts the abrt daemon
5 # description: Daemon to detect crashing apps
9 # Required-Start: $syslog $local_fs
10 # Required-Stop: $syslog $local_fs
11 # Default-Stop: 0 1 2 6
13 # Short-Description: start and stop abrt daemon
14 # Description: Listen and dispatch crash events
17 # Source function library.
18 . /etc/rc.d/init.d/functions
21 . /etc/sysconfig/network
23 # Get service config - may override defaults
24 [ -f /etc/sysconfig/abrtd ] && . /etc/sysconfig/abrtd
26 # Check that networking is up.
27 if is_yes "${NETWORKING}"; then
28 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
29 msg_network_down "abrt daemon"
37 # must return non-zero if check failed
38 # output is discarded if checkconfig is ran without details
40 # Check if abrt is executable
41 test -x /usr/sbin/abrtd || return 5
44 # wrapper for configtest
48 if [ $details = 1 ]; then
49 # run config test and display report (status action)
50 show "Checking %s configuration" "abrt daemon"; busy
52 out=$(configtest 2>&1)
54 if [ $RETVAL = 0 ]; then
59 [ "$out" ] && echo >&2 "$out"
61 # run config test and abort with nice message if failed
62 # (for actions checking status before action).
63 configtest >/dev/null 2>&1
65 if [ $RETVAL != 0 ]; then
66 show "Checking %s configuration" "abrt daemon"; fail
67 nls 'Configuration test failed. See details with %s "checkconfig"' $0
74 # Check if the service is already running?
75 if [ -f /var/lock/subsys/abrtd ]; then
76 msg_already_running "abrt daemon"
81 msg_starting "abrt daemon"
82 daemon /usr/sbin/abrtd
84 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/abrtd
88 if [ ! -f /var/lock/subsys/abrtd ]; then
89 msg_not_running "abrt daemon"
94 msg_stopping "abrt daemon"
96 rm -f /var/lock/subsys/abrtd
100 if [ ! -f /var/lock/subsys/abrtd ]; then
101 msg_not_running "abrt daemon"
112 # See how we were called.
131 checkconfig|configtest)
139 msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"