Sophie

Sophie

distrib > Mageia > 1 > x86_64 > by-pkgid > 34628d607ba9e07c2b879273d07d27e6 > files > 7

abrt-1.1.17-1.mga1.x86_64.rpm

#!/bin/bash
# Starts the abrt daemon
#
# chkconfig: 35 82 16
# description: Daemon to detect crashing apps
# processname: abrtd
### BEGIN INIT INFO
# Provides: abrt
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: start and stop abrt daemon
# Description: Listen and dispatch crash events
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

#
# See how we were called.
#

check() {
	# Check that we're a privileged user
	[ `id -u` = 0 ] || exit 4

	# Check if abrt is executable
	test -x /usr/sbin/abrtd || exit 5
}

start() {

	check

	# Check if it is already running
	if [ ! -f /var/lock/subsys/abrtd ]; then
		gprintf "Starting abrt daemon: "
		daemon /usr/sbin/abrtd
		RETVAL=$?
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/abrtd
		echo
	fi
	return $RETVAL
}

stop() {

	check

	gprintf "Stopping abrt daemon: "
	killproc /usr/sbin/abrtd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/abrtd
	echo
	return $RETVAL
}


restart() {
	stop
	start
}

reload() {
	restart
}

case "$1" in
start)
	start
	;;
stop)
	stop
	;;
reload)
	reload
	;;
force-reload)
	gprintf "%s: Unimplemented feature.\n" "$0"
	RETVAL=3
	;;
restart)
	restart
	;;
condrestart)
	if [ -f /var/lock/subsys/abrtd ]; then
	    restart
	fi
	;;
status)
	status abrt
	RETVAL=$?
	;;
*)
	gprintf "Usage: %s {start|stop|status|restart|condrestart|reload|force-reload}\n" "$0"
	RETVAL=2
esac

exit $RETVAL