#!/bin/bash # # kerneloops # # chkconfig: 345 90 88 # description: A tool that collects and submits kernel crash \ # signatures to the kerneloops.org website for use by the Linux \ # kernel developers. # processname: kerneloops # config: /etc/kerneloops.conf # ### BEGIN INIT INFO # Provides: kerneloops # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Required-Start: $local_fs $remote_fs $named $network $time $syslog # Required-Stop: $local_fs $remote_fs $syslog # Short-Description: Tool to automatically collect and submit kernel crash signatures # Description: A tool that collects and submits kernel crash # signatures to the kerneloops.org website for use by the Linux # kernel developers. ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions exec="/usr/sbin/kerneloops" prog=$(basename $exec) sconf="/etc/kerneloops.conf" lockfile=/var/lock/subsys/$prog [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog start() { gprintf "Starting %s:" "$prog" daemon $prog $OPTS retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { gprintf "Stopping %s: " "$prog" killproc $prog retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } reload() { restart } force_reload() { restart } fdr_status() { status $prog } case "$1" in start|stop|restart|reload) $1 ;; force-reload) force_reload ;; status) fdr_status ;; condrestart|try-restart) [ -f $lockfile ] || restart ;; *) gprintf "Usage: %s {start|stop|status|restart|try-restart|reload|force-reload}\n" "$0" exit 1 esac