diff --git a/systemvm/debian/etc/systemd/system/cloud-early-config.service b/systemvm/debian/etc/systemd/system/cloud-early-config.service index 2af52767cc3..50f0f2b0067 100644 --- a/systemvm/debian/etc/systemd/system/cloud-early-config.service +++ b/systemvm/debian/etc/systemd/system/cloud-early-config.service @@ -14,5 +14,5 @@ WantedBy=multi-user.target [Service] Type=oneshot ExecStart=/opt/cloud/bin/setup/cloud-early-config -RemainAfterExit=true +RemainAfterExit=no TimeoutStartSec=5min diff --git a/systemvm/debian/etc/systemd/system/cloud-postinit.service b/systemvm/debian/etc/systemd/system/cloud-postinit.service index cb20aaf7c06..16717578bee 100644 --- a/systemvm/debian/etc/systemd/system/cloud-postinit.service +++ b/systemvm/debian/etc/systemd/system/cloud-postinit.service @@ -9,5 +9,5 @@ WantedBy=multi-user.target [Service] Type=oneshot ExecStart=/opt/cloud/bin/setup/postinit.sh -RemainAfterExit=true +RemainAfterExit=no TimeoutStartSec=10min diff --git a/systemvm/debian/etc/systemd/system/cloud.service b/systemvm/debian/etc/systemd/system/cloud.service index 22439239caa..e3824bf53c2 100644 --- a/systemvm/debian/etc/systemd/system/cloud.service +++ b/systemvm/debian/etc/systemd/system/cloud.service @@ -1,6 +1,6 @@ [Unit] Description=CloudStack Agent service -After=cloud-early-config.service network.target local-fs.target +After=cloud-early-config.service network.target cloud-postinit.service local-fs.target [Install] WantedBy=multi-user.target diff --git a/systemvm/debian/etc/systemd/system/open-vm-tools.service b/systemvm/debian/etc/systemd/system/open-vm-tools.service deleted file mode 100644 index b8afec52f65..00000000000 --- a/systemvm/debian/etc/systemd/system/open-vm-tools.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Service for virtual machines hosted on VMware -Documentation=http://open-vm-tools.sourceforge.net/about.php -ConditionVirtualization=vmware -DefaultDependencies=no -Before=cloud-init-local.service -After=local-fs.target - -[Service] -ExecStart=/usr/bin/vmtoolsd -TimeoutStopSec=5 -Restart=always -RestartSec=15 - -[Install] -WantedBy=multi-user.target diff --git a/systemvm/debian/opt/cloud/bin/setup/postinit.sh b/systemvm/debian/opt/cloud/bin/setup/postinit.sh index 967e90f1411..5eb8f5568aa 100755 --- a/systemvm/debian/opt/cloud/bin/setup/postinit.sh +++ b/systemvm/debian/opt/cloud/bin/setup/postinit.sh @@ -31,10 +31,38 @@ fi sysctl -p # HYPERVISOR exported by cloud-early-config -# stop ntp conflicting with vmtools -if [ "$HYPERVISOR" == "vmware" ]; then - systemctl stop ntpd -fi + +case $HYPERVISOR in + xen-pv|xen-domU) + systemctl stop ntpd + systemctl start xe-daemon xenstored + ;; + xen-hvm) + systemctl stop ntpd + systemctl start xe-daemon xenstored + + ;; + kvm) + systemctl start qemu-guest-agent + VPORT=$(find /dev/virtio-ports -type l -name '*.vport' 2>/dev/null|head -1) + ;; + vmware) + systemctl stop ntpd + systemctl start vmtoolsd + + ;; + virtualpc|hyperv) + # Hyper-V is recognized as virtualpc hypervisor type. Boot args are passed using KVP Daemon + systemctl start hyperv-daemons + ;; + virtualbox) + # Virtualbox is used to test the virtual router + + ;; + esac + + + # Restart journald for setting changes to apply systemctl restart systemd-journald diff --git a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh index a12a2233743..dba9234fec8 100644 --- a/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh +++ b/tools/appliance/systemvmtemplate/scripts/configure_systemvm_services.sh @@ -110,6 +110,9 @@ function configure_services() { systemctl disable xl2tpd systemctl disable vgauth + # Disable guest services which will selectively be started based on hypervisor + systemctl disable vmtoolsd xe-daemon qemu-guest-agent hyperv-daemons xenstored + configure_apache2 configure_strongswan configure_issue