[systemd-devel] Running a script as FIRST script before shutdown

Luca Bertoncello L.Bertoncello at queo-group.com
Wed Sep 23 07:20:45 PDT 2015


Hi list!

I'm new here and I hope, I'm in topic... I don't want to develop system, but I didn't found a "system-user"-ML...

So, to my problem:
I need a possibility to call a script on shutdown/reboot/halt (I use CentOS 7). This **MUST** be the first one be called, since it needs many other service to be running...
The second important thing is, that the shutdown-process has to wait until my script ends.

Right now I got my script to be called, but:
1) not as first script on shutdown
2) shutdown does not wait, so that my script cannot do what it should...

My definition:

[Unit]
Description=SHUTDOWN oVirt
Before=shutdown.target reboot.target halt.target
Wants=local-fs.target remote-fs.target network.target

[Service]
Type=simple
ExecStart=/bin/true
ExecStop=/usr/local/bin/ovirt-maintenance.sh maintenance
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Can someone help me?

Thanks a lot for your help!

Mit freundlichen Grüßen

Luca Bertoncello

-- 
Besuchen Sie unsere Webauftritte:

www.queo.biz		Agentur für Markenführung und Kommunikation
www.queoflow.com	IT-Consulting und Individualsoftwareentwicklung

Luca Bertoncello
Administrator
Telefon:	+49 351 21 30 38 0
Fax:		+49 351 21 30 38 99
E-Mail:	l.bertoncello at queo-group.com

queo GmbH
Tharandter Str. 13
01159 Dresden
Sitz der Gesellschaft: Dresden
Handelsregistereintrag: Amtsgericht Dresden HRB 22352
Geschäftsführer: Rüdiger Henke, André Pinkert
USt-IdNr.: DE234220077


More information about the systemd-devel mailing list