#!/bin/sh ############################################################################### # $Id: edac.init 4265 2007-05-07 21:39:23Z grondo $ ############################################################################### # Copyright (C) 2006-2007 The Regents of the University of California. # Produced at Lawrence Livermore National Laboratory. # Written by Mark Grondona <mgrondona@llnl.gov> # UCRL-CODE-230739. ############################################################################### # chkconfig: - 40 60 ############################################################################### ### BEGIN INIT INFO # Provides: edac # Required-Start: $named $time # Default-Stop: 0 1 2 6 # Description: Initialize EDAC drivers for machine hardware # Short-Description: Initialize EDAC drivers for machine hardware ### END INIT INFO ############################################################################### if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0; fi SERVICE="edac" PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin EDAC=/usr/sbin/edac-ctl EDAC_UTIL=/usr/bin/edac-util LOGGER="logger -t $SERVICE -p info" SUBSYS=/var/lock/subsys/edac ############################################################################### service_start () { # Start the service. Required by LSB. # echo -n "Starting ${SERVICE}: " $EDAC --register-labels 2>&1 | $LOGGER; rc=$?; if [ $rc -eq 0 ]; then daemon true; touch $SUBSYS; else daemon false; fi echo; } ############################################################################### service_stop () { echo -n "Stopping ${SERVICE}: " daemon $EDAC --unload; rc=$? rm -f $SUBSYS; echo; } ############################################################################### service_status () { # Print the current status of the service. Required by LSB. # $EDAC_UTIL --status rc=0 } ############################################################################### rc=4 case "$1" in start) service_start ;; stop) service_stop ;; status) service_status ;; restart|reload) service_stop service_start ;; *) COMMANDS="start|stop|status|restart|reload" echo "Usage: $0 {${COMMANDS}}" exit 1 ;; esac exit $rc;