"Fossies" - the Fresh Open Source Software Archive

Member "freeipmi-1.6.8/etc/ipmiseld.init" (20 May 2021, 2378 Bytes) of package /linux/misc/freeipmi-1.6.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "ipmiseld.init": 1.6.7_vs_1.6.8.

    1 #!/bin/sh
    2 # $Id: ipmiseld.init,v 1.1 2009-10-01 18:09:57 chu11 Exp $
    3 #
    4 # chkconfig: - 70 40
    5 # description: ipmiseld startup script
    6 #
    7 ### BEGIN INIT INFO
    8 # Provides: ipmiseld
    9 # Required-Start: $network $remote_fs $syslog
   10 # Required-Stop:  $network $remote_fs $syslog
   11 # Default-Start:  3 5
   12 # Default-Stop:   0 1 2 6
   13 # Short-Description: Start and stop ipmidetectd
   14 # Description: IPMI SEL sylog logging daemon
   15 ### END INIT INFO
   16 
   17 IPMISELD=/usr/local/sbin/ipmiseld
   18 IPMISELD_CONF=/usr/local/etc/freeipmi/ipmiseld.conf
   19 LOCKFILE=/usr/local/var/lock/subsys/ipmiseld
   20 
   21 [ -f $IPMISELD ] || exit 5
   22 [ -f $IPMISELD_CONF ] || exit 6
   23 
   24 # Load Redhat or Suse appropriate libs
   25 if [ -f /usr/local/etc/rc.d/init.d/functions ] ; then
   26     . /usr/local/etc/rc.d/init.d/functions
   27     Xstart() {
   28         daemon $IPMISELD
   29         RETVAL=$?
   30         echo
   31         [ $RETVAL -eq 0 ] && touch $LOCKFILE
   32     }
   33     Xstop() {
   34         killproc ipmiseld -TERM
   35         RETVAL=$?
   36         echo
   37         [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
   38     }
   39     Xstatus() {
   40         status ipmiseld
   41         RETVAL=$?
   42         return $RETVAL
   43     }
   44     Xcondrestart() {
   45         if test -e $LOCKFILE; then
   46             $0 stop
   47             $0 start
   48             RETVAL=$?
   49         fi
   50     }
   51     Xexit() {
   52         exit $RETVAL
   53     }
   54 elif [ -f /usr/local/etc/rc.status ] ; then
   55     . /usr/local/etc/rc.status
   56     Xstart() {
   57         startproc $IPMISELD
   58         rc_status -v
   59     }
   60     Xstop() {
   61         killproc -TERM $IPMISELD
   62         rc_status -v
   63     }
   64     Xstatus() {
   65         echo -n "Checking for ipmiseld: "
   66         checkproc $IPMISELD
   67         rc_status -v
   68     }
   69     Xcondrestart() {
   70         $0 status
   71         if test $? = 0; then
   72             $0 restart
   73         else
   74             rc_reset
   75         fi
   76         rc_status
   77     }
   78     Xexit() {
   79         rc_exit
   80     }
   81 else
   82     echo "Unknown distribution type"
   83     exit 1
   84 fi
   85 
   86 RETVAL=0
   87 
   88 case "$1" in
   89    start)
   90         echo -n "Starting ipmiseld: "
   91         Xstatus >/dev/null 2>&1 && exit 0
   92         Xstart
   93         ;;
   94   stop)
   95         echo -n "Shutting down ipmiseld: "
   96         Xstop
   97         ;;
   98   restart)
   99         $0 stop
  100         $0 start
  101         RETVAL=$?
  102         ;;
  103   status)
  104         Xstatus
  105         ;;
  106   condrestart|try-restart|force-reload)
  107         Xcondrestart
  108         ;;
  109   *)
  110         echo "Usage: $0 {start|stop|restart|status|condrestart|try-restart|force-reload}"
  111         exit 2
  112 esac
  113 exit $RETVAL