Files
linuxkit/alpine/packages/hvtools/etc/init.d/hv_kvp_daemon
Rolf Neugebauer bdd1efe043 alpine: Add Hyper-V daemons to the build
The daemons allow proper shutdown of a VM, heartbeats,
inquiring and setting the network configuratio etc etc.

They are only started with running in a Hyper-V VM

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-01-28 09:17:44 -08:00

32 lines
714 B
Plaintext
Executable File

#!/sbin/openrc-run
HV_DAEMON=hv_kvp_daemon
start()
{
[ ! -d /sys/bus/vmbus ] && exit 0
ebegin "Starting Hyper-V Daemon: ${HV_DAEMON}"
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/${HV_DAEMON}.pid
start-stop-daemon --start --quiet \
--background \
--exec /sbin/${HV_DAEMON} \
--make-pidfile --pidfile ${PIDFILE} \
--
eend 0
}
stop()
{
[ ! -d /sys/bus/vmbus ] && exit 0
ebegin "Stopping Hyper-V Daemon: ${HV_DAEMON}"
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/${HV_DAEMON}.pid
start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
eend $? "Failed to stop ${HV_DAEMON}"
}