forgot to push abrt-vmcore.init

This commit is contained in:
Jiri Moskovcak 2011-09-23 19:12:03 +02:00
parent 4a1b212d07
commit 942930fbda

79
abrt-vmcore.init Normal file
View File

@ -0,0 +1,79 @@
#!/bin/bash
# Harvest vmcores for ABRT
#
# chkconfig: 35 82 16
# description: Installs coredump handler which saves segfault data
### BEGIN INIT INFO
# Provides: abrt-vmcore
# Required-Start: $abrtd
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: Collects vmcore (kernel crash data) for ABRT
# Description: Collects vmcore (kernel crash data) for ABRT
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
LOCK="/var/lock/subsys/abrt-vmcore"
HARVEST_CMD="/usr/sbin/abrt-harvest-vmcore"
RETVAL=0
check() {
# Check that we're a privileged user
[ "`id -u`" = 0 ] || exit 4
}
start() {
check
"$HARVEST_CMD"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch -- "$LOCK"
return $RETVAL
}
stop() {
check
rm -f -- "$LOCK"
return 0
}
restart() {
stop
start
}
reload() {
restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
test -f "$LOCK" && restart
;;
status)
test -f "$LOCK" && RETVAL=0 || RETVAL=3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL