]> git.pld-linux.org Git - packages/ipmitool.git/blob - ipmitool-ipmievd.init
- fixed tag from version
[packages/ipmitool.git] / ipmitool-ipmievd.init
1 #!/bin/sh
2 #
3 # ipmievd daemon to send events to syslog
4 #
5 # chkconfig:    2345 80 30
6 #
7 # description: ipmievd daemon to send events to syslog
8 #
9 # Description: Start ipmievd to read events from BMC and
10 #                  log them to syslog.
11 #                  Events correspond to hardware faults,
12 #                  state transitions such as power on and off, and sensor
13 #                  readings such as temperature, voltage and fan speed that
14 #                  are abnormal.
15 #
16 # processname: ipmievd
17 # config:      /etc/sysconfig/ipmievd
18 #
19 # $Id$
20
21 # Source function library
22 . /etc/rc.d/init.d/functions
23
24 IPMIEVD_OPTIONS=
25 IPMIEVD_INTERFACE=open
26
27 # Get service config - may override defaults
28 [ -f /etc/sysconfig/ipmievd ] && . /etc/sysconfig/ipmievd
29
30 start() {
31         # Check if the service is already running?
32         if [ -f /var/lock/subsys/ipmievd ]; then
33                 msg_already_running "ipmievd"
34                 return
35         fi
36
37         msg_starting "ipmievd"
38         daemon /usr/sbin/ipmievd -I $IPMIEVD_INTERFACE $IPMIEVD_OPTIONS
39         RETVAL=$?
40         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipmievd
41 }
42
43 stop() {
44         if [ ! -f /var/lock/subsys/ipmievd ]; then
45                 msg_not_running "ipmievd"
46                 return
47         fi
48
49         # Stop daemons.
50         msg_stopping "ipmievd"
51         killproc ipmievd
52         rm -f /var/lock/subsys/ipmievd
53 }
54
55 condrestart() {
56         if [ ! -f /var/lock/subsys/ipmievd ]; then
57                 msg_not_running "ipmievd"
58                 RETVAL=$1
59                 return
60         fi
61
62         stop
63         start
64 }
65
66 RETVAL=0
67 # See how we were called.
68 case "$1" in
69   start)
70         start
71         ;;
72   stop)
73         stop
74         ;;
75   restart)
76         stop
77         start
78         ;;
79   try-restart)
80         condrestart 0
81         ;;
82   force-reload)
83         condrestart 7
84         ;;
85   status)
86         status ipmievd
87         RETVAL=$?
88         ;;
89   *)
90         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
91         exit 3
92 esac
93
94 exit $RETVAL
This page took 0.078842 seconds and 3 git commands to generate.