60 строки
1.1 KiB
Bash
60 строки
1.1 KiB
Bash
#!/bin/bash
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: hv_vss_daemon
|
|
# Required-Start: $null
|
|
# Should-Start: $syslog $remote_fs $time
|
|
# Required-Stop: $null
|
|
# Should-Stop: $syslog $remote_fs $time
|
|
# Default-Start: 3 5
|
|
# Default-Stop: 0 1 2 6
|
|
# Short-Description: hv_vss_daemon provides info to the host
|
|
# Description: Start hv_vss_daemon to allow the host to query this guest
|
|
### END INIT INFO
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
RETVAL=0
|
|
HV_VSS_BIN=/usr/sbin/hv_vss_daemon
|
|
|
|
# Check for missing binaries
|
|
test -x $HV_VSS_BIN || { echo "$HV_VSS_BIN not installed";
|
|
if [ "$1" = "stop" ]; then exit 0;
|
|
else exit 5; fi; }
|
|
|
|
start(){
|
|
if ! status $HV_VSS_BIN >&/dev/null; then
|
|
echo -n "Starting Hyper-V VSS daemon "
|
|
daemon $HV_VSS_BIN
|
|
RETVAL=$?
|
|
else
|
|
echo -n "Hyper-V VSS daemon is already started"
|
|
fi
|
|
echo
|
|
}
|
|
|
|
stop(){
|
|
echo -n "Shutting down Hyper-V VSS daemon "
|
|
killproc $HV_VSS_BIN
|
|
RETVAL=$?
|
|
echo
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
status)
|
|
status $HV_VSS_BIN
|
|
RETVAL=$?
|
|
;;
|
|
*)
|
|
echo $"Usage: $0 {start|stop|status}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $RETVAL
|