]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - debian/linux-cloud-tools-common.hv-kvp-daemon.upstart
UBUNTU: [debian] Initial debian and ubuntu directories
[mirror_ubuntu-artful-kernel.git] / debian / linux-cloud-tools-common.hv-kvp-daemon.upstart
diff --git a/debian/linux-cloud-tools-common.hv-kvp-daemon.upstart b/debian/linux-cloud-tools-common.hv-kvp-daemon.upstart
new file mode 100644 (file)
index 0000000..198184a
--- /dev/null
@@ -0,0 +1,22 @@
+# On Azure/Hyper-V systems start the hv_kvp_daemon
+#
+description "Hyper-V KVP Protocol Daemon"
+author "Adam Conrad <adconrad@canonical.com>"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+console log
+
+pre-start script
+        if [ -e "/etc/default/hv-kvp-daemon-init" ]; then
+                . /etc/default/hv-kvp-daemon-init
+        fi
+        [ "$RUN_KVP_DAEMON" = 0 ] && { stop; exit 0; }
+       if [ -d /sys/class/dmi/id/. ]; then
+               read company </sys/class/dmi/id/sys_vendor
+               read product </sys/class/dmi/id/product_name
+               [ "$company:$product" = 'Microsoft Corporation:Virtual Machine' ] || { stop; exit 0; }
+       fi
+end script
+
+exec /usr/sbin/hv_kvp_daemon -n