Am 29.02.2012 17:16, schrieb Lennart Poettering:
> On Sun, 26.02.12 19:13, Reindl Harald (h.rei...@thelounge.net) wrote:
> 
>> the ExecStop is called but systemd DOES NOT wait
>> until it is finished leading to all virtual machines
>> are killed hard while "systemctl stop vmware-default.service"
>> does supsend them perfectlly as long it is not combined with
>> any sort of shutdown
> 
> systemd waits for ExecStop= to finish before executing later jobs (well,
> subject to a timeout, of a couple of minutes).
> 
> What really matters is that you order your service before/after the
> right things, and be aware that:
> 
> a) the stop order is implicitly the reverse of the start order
> 
> b) if a job is started and another one stopped and they are ordered
> against each other, then the stop is executed first, and the start
> executed second, regardless which kind of ordering is actually
> configured

by the way - somewhere around Fedora 18 without change anything
on my side systemd no longer kills ExecStop and so suspending
VM's, meaning this was clearly a systemd bug as i reported it

ExecStartPost=-/usr/bin/su -c "/scripts/vmware/vm-default-start.sh" vmware
ExecStop=-/scripts/vmware/vm-suspend-all.sh

[root@srv-rhsoft:~]$ cat /scripts/vmware/vm-suspend-all.sh
#!/usr/bin/bash
if [ -x /usr/bin/vmrun ] ; then
 for i in `pidof vmware-vmx` ; do
  VMX_PATH=`ps -p $i -f | sed -ne '/vmware/s/.* \(\/.*\.vmx\)/\1/p'`
  /usr/bin/logger -t vmware "SUSPEND: $VMX_PATH"
  /usr/bin/vmrun suspend `ps -p $i -f | sed -ne '/vmware/s/.* 
\(\/.*\.vmx\)/\1/p'` 2> /dev/null
  /usr/bin/logger -t vmware "SUSPENDED: $VMX_PATH"
 done
fi
/usr/bin/bash /vmware/permissions.sh
exit 0

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to