[systemd-devel] /etc/rc.d/ on shutdown incompatible

Lennart Poettering lennart at poettering.net
Mon Aug 1 15:57:20 PDT 2011


On Fri, 22.07.11 10:39, Reindl Harald (h.reindl at thelounge.net) wrote:

> i think systemd does not wait until this script has finsished
> what can take some minutes if you have and hand full of virtual
> machines running with hughe memory

We wait for all operations, but we time them out. SysV start/stop
scripts are timed out after 5min which should be plenty time even for
the slowest scripts. You can freely increase (or even disable that) in
unit files.

> independent from a needed fix somewhere in systemd:
> what is the best way to place any shell script which is
> called at the first place before reboot/shutdown and
> how force systemd to wait with all other shutdwon-actions
> until this is finished?

first place before boot? What's that? in initrd?

If you want an executable started during boot, the easiest way is to
stick it some place (for example /usr/local/bin), and then place a unit
file like this in /etc/systemd/system/yourservice.service:

[Service]
ExecStart=/usr/local/bin/myservice

and then symlink this file to
/etc/systemd/system/multi-user.target.wants/yourservice.service to start
at boot.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list