You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pa...@apache.org on 2018/12/12 22:11:46 UTC
[cloudstack] 13/18: base attempt to move disable services and
selectively start them
This is an automated email from the ASF dual-hosted git repository.
paul_a pushed a commit to branch 41120-memory
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit ea6f0de8f01de35e5bb1d19db626e4ff1ba5cef7
Author: Paul Angus <pa...@shapeblue.com>
AuthorDate: Sat Dec 8 21:10:04 2018 +0000
base attempt to move disable services and selectively start them
---
.../etc/systemd/system/cloud-early-config.service | 2 +-
.../etc/systemd/system/cloud-postinit.service | 2 +-
systemvm/debian/etc/systemd/system/cloud.service | 2 +-
.../etc/systemd/system/open-vm-tools.service | 16 ----------
systemvm/debian/opt/cloud/bin/setup/postinit.sh | 36 +++++++++++++++++++---
.../scripts/configure_systemvm_services.sh | 3 ++
6 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/systemvm/debian/etc/systemd/system/cloud-early-config.service b/systemvm/debian/etc/systemd/system/cloud-early-config.service
index 2af5276..50f0f2b 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 cb20aaf..1671757 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 2243923..e3824bf 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 b8afec5..0000000
--- 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 967e90f..5eb8f55 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 a12a223..dba9234 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