[systemd-devel] customized shutdown service needed

Reindl Harald h.reindl at thelounge.net
Sun Feb 26 10:13:21 PST 2012



Am 26.02.2012 17:24, schrieb Burkhard Kayser:
> Hello,
> I do need a customized shutdown service which performs some clean up tasks, e.g. stopping virtual machines,  before
> the shutdown service of systemd actually starts.
> The shutdown of the system shall be delayed until my script is terminated.
> 
> I could not find a suitable configuration. The "templates" in /lib/systemd did not help.
> 
> I've an OpenSuSE 12.1 system with latest patches installed.
> 
> Here is my configuration:
> 
>     [Unit]
>     Description=my shutdown service
> 
>     Before=shutdown.service halt.service
>     DefaultDependencies=no
> 
>     [Service]
>     ExecStart=/etc/init.d/my_shutdown start
>     Type=oneshot
>     RemainAfterExit=true
> 
>     [Install]
>     WantedBy=shutdown.target

the same still here since updatd to F15

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

[root at srv-rhsoft:~]$ cat /etc/systemd/system/vmware-default.service
[Unit]
Description=VMware-Default-Machines
After=vmware.service

[Service]
Type=oneshot
ExecStart=/bin/su -c "/scripts/vmware/vm-default-start.sh" vmware
ExecStop=/scripts/vmware/vm-suspend-all.sh
RemainAfterExit=yes
TimeoutSec=600
SysVStartPriority=90

[Install]
WantedBy=multi-user.target


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120226/78011253/attachment.pgp>


More information about the systemd-devel mailing list