5
# Required-Start: $network $remote_fs $syslog
6
# Required-Stop: $network $remote_fs $syslog
9
# Default-Start: 2 3 4 5
11
# Short-Description: Start OpenHPI daemon at boot time
12
# Description: Enable OpenHPI service which is provided by openhpid.
15
# openhpid.sh Start/Stop the openhpi daemon.
17
# description: openhpid is standard UNIX program which uses the OpenHPI \
18
# APIs and provides a standard internet server to access those \
19
# APIs for client programs.
20
# processname: openhpid
21
# config: the standard openhpi conf file specified on the command line or the env.
22
# pidfile: /var/run/openhpid.pid
25
# W. David Ashley <dashley@us.ibm.com>
26
# Daniel de Araujo <ddearauj@us.ibm.com>
28
# Source function library.
29
PATH=/sbin:/bin:/usr/sbin:/usr/bin
32
# If the openhpid executable is not available, we can't do any of this
33
test -f /usr/sbin/openhpid || exit 0
35
# Determine whether the lsb package is installed
36
# If it is, determine which lsb is installed:
37
# redhat, suse, or standard lsb
39
if test -f /etc/init.d/functions
42
. /etc/init.d/functions
43
elif test -f /etc/rc.status
47
elif test -f /lib/lsb/init-functions
50
. /lib/lsb/init-functions
51
elif test -f /etc/gentoo-release
76
log_success_msg "success"
78
log_failure_msg "failed"
103
echo -n "Starting $prog: "
104
daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
108
echo -n "Starting $prog: "
109
startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
113
echo -n "Starting $prog: "
114
start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
118
ebegin "Starting $prog: "
119
start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
123
echo -n "Starting $prog: "
124
/usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
138
echo -n "Stopping $prog: "
139
killproc /usr/sbin/openhpid
144
ebegin "Stopping $prog: "
145
start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
150
echo -n "Stopping $prog: "
151
if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
153
kill "`cat /var/run/openhpid.pid`"
164
if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
166
rm -f /var/lock/openhpid
167
rm -f /var/run/openhpid.pid
173
echo "Checking for $prog daemon: "
178
status /usr/sbin/openhpid
181
checkproc /usr/sbin/openhpid
185
pid="`pidofproc /usr/sbin/openhpid`"
186
if test "${pid}" != ""
188
log_success_msg "$prog is running"
190
log_success_msg "$prog is not running"
194
if test -f /var/run/openhpid.pid &&
195
test "`cat /var/run/openhpid.pid`" != "" &&
196
kill -s 0 "`cat /var/run/openhpid.pid`"
198
echo "$prog is running"
200
echo "$prog is not running"
217
# We don't currently support a reload, but can do a restart
222
# See how we were called.
241
echo "Usage: $0 {start|stop|restart|status|force-reload}"