add sysv init script

This commit is contained in:
Andrew A. Vasilyev 2019-05-06 19:52:37 +03:00
parent f9daad70d4
commit 1d42a96e60

106
.gear/fence_virtd.init Normal file
View File

@ -0,0 +1,106 @@
#!/bin/sh
#
# fence-virtd Virtual Machine Fencing host daemon.
#
# chkconfig: 2345 98 01
# description: Fence_virtd is a fencing host daemon which routes fencing \
# requests from clusters of virtual machines to various \
# management layers.
# processname: fence-virtd
# config: /etc/fence-virtd.conf
# pidfile: /var/run/fence-virtd.pid
### BEGIN INIT INFO
# Provides: fence_virtd
# Required-Start: network
# Required-Stop:
# Should-Start: fence-virtd
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: start and stop fence_virtd
# description: Fence_virtd handles fencing requests from VMs
### end init info
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
PIDFILE=/var/run/$SERVICE.pid
LOCKFILE=/var/lock/subsys/$SERVICE
FENCE_VIRTD_ARGS="-w"
SourceIfNotEmpty /etc/sysconfig/fence-virtd
RETVAL=0
start()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- "$SERVICE" $FENCE_VIRTD_ARGS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- "$SERVICE"
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading "$SERVICE"
stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- "$SERVICE"
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root -- "$SERVICE"
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL