On Sun, 26.02.12 17:24, Burkhard Kayser (kayser-b-2...@t-online.de) wrote:

>    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.

Well, the intended mode of operation here is that services that are
started at boot are shut down at shutdown. Hence normally you would
place any code you want to run at shutdown in the ExecStop= of the
service in question.

A number of services are run only at shutdown, and have no counterpart
at boot-up. These are "special", and live outside the default depndency
logic, and need to be marked with DefaultDependencies=no for that. When
exactly they are run depends on how you configure things. One possible
option here is to order them between shutdown.target and final.target,
which makes the server to be started after all normal services are shut
down, but before we actually do the low-level termination. If such a
service shell complete before we continue with the shut down you need to
use Type=oneshot.

>      Before=shutdown.service halt.service

There is no shutdown.service. And halt.service is most likely not what
you want to use, since it's responsible for actually halting the machine
(as opposed to reboot or power it off)

>      DefaultDependencies=no
> 
>      [Service]
>      ExecStart=/etc/init.d/my_shutdown start

This is not a SysV script, you should not place it in this directory.

>      Type=oneshot
>      RemainAfterExit=true

RemainAfterExit= makes little sense here.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to