Am 15.08.2017 um 16:25 schrieb Reiner Wenke:
I have running some virtualbox instances under systemd control and use 
vboxautostart-service
for starting and stopping (saving). This is running on Centos7
As long as I use systemctl stop vboxautostart-service for termination, 
everything is fine,
but it takes some time for completion.

If I shutdown or reboot the host system, then I get a premature kill of all 
running instances,
most likely through the systemd reboot / shutdown routines .
I tried some configuration changes, but nothing worked for me.

Is there a reliable way to avoid this behavior?

you need to remember that the sequence of shutdown is the exactly verse of startup to begin with and adjust "TimeoutStopSec" in case running guests are suspended at shutdown

i finally throwed away anything from VMware Workstation including the module-load stuffm dhcp and so on and solved it with own services, tragtes and dependencies - below a part of the unit files to get an idea


[root@srv-rhsoft:~]$ cat /etc/systemd/system/vmware-guest.target
[Unit]
Description=VMware Guest Group
After=vmware.service vmware.target network-wan-bridge.service display-manager.service
Requires=vmware.service vmware-modules.service vmware-vmnet.service
Wants=guest-arrakis.service
Wants=guest-testserver.service
Wants=display-manager.service

[Install]
WantedBy=graphical.target
____________________________________________

[root@srv-rhsoft:~]$ cat /etc/systemd/system/vmware.service
[Unit]
Description=VMware Workstation Service
Requires=vmware-modules.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/systemctl start vmware.target
ExecStop=-/scripts/vmware/vm-suspend-all.sh
ExecStop=/usr/bin/systemctl stop vmware.target
TimeoutSec=1800
TimeoutStopSec=1800
ReadOnlyDirectories=/etc
ReadOnlyDirectories=/usr
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_PTRACE

[Install]
WantedBy=multi-user.target
____________________________________________

[root@srv-rhsoft:~]$ cat /etc/systemd/system/vmware.target
[Unit]
Description=VMware Service Group
Requires=vmware-modules.service vmware-vmnet.service
Wants=vmware-authentication.service
Wants=vmware-usb.service

[Install]
WantedBy=multi-user.target
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to