<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
I tried as well the following configuration. My script shall be
started before ANY other service is shut down.<br>
Stopping a virtual machine is only one example. Synchronizing data
into a truecrypt container another.<br>
<br>
<br>
<blockquote> [Unit]<br>
Description=my shutdown service<br>
<br>
Before=shutdown.service halt.service shutdown.target umount.target<br>
DefaultDependencies=no<br>
<br>
[Service]<br>
ExecStart=/etc/init.d/my_shutdown start<br>
Type=oneshot<br>
RemainAfterExit=true<br>
TimeoutSec=600<br>
<br>
[Install]<br>
WantedBy=shutdown.target<br>
<br>
</blockquote>
<br>
<br>
My script is started almost at the end of the shutdown sequence. See
var/log/messages below.<br>
<br>
<br>
<blockquote>Feb 28 20:26:54 Linux1 systemd[1]: alsa-store.service:
main process exited, code=exited, status=19<br>
Feb 28 20:26:54 Linux1 systemd[1]: Unit alsa-store.service entered
failed state.<br>
Feb 28 20:26:54 Linux1 sshd[2233]: Exiting on signal 15<br>
Feb 28 20:26:54 Linux1 alsactl[2391]: /usr/sbin/alsactl:
save_state:1519: No soundcards found...<br>
Feb 28 20:26:54 Linux1 haveged: haveged stopping due to signal 15<br>
Feb 28 20:26:54 Linux1 umount[2374]: umount:
/var/lib/nfs/rpc_pipefs: device is busy.<br>
Feb 28 20:26:54 Linux1 umount[2374]: (In some cases useful info
about processes that use<br>
Feb 28 20:26:54 Linux1 avahi-daemon[652]: avahi-daemon 0.6.30
exiting.<br>
Feb 28 20:26:54 Linux1 umount[2374]: the device is found by
lsof(8) or fuser(1))<br>
Feb 28 20:26:54 Linux1 systemd[1]: var-lib-nfs-rpc_pipefs.mount
mount process exited, code=exited status=1<br>
Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-etc.mount
entered failed state.<br>
Feb 28 20:26:55 Linux1 systemd[1]: Unit srv-mywiki.mount entered
failed state.<br>
Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-tmp.mount
entered failed state.<br>
Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-Download.mount
entered failed state.<br>
Feb 28 20:26:55 Linux1 logger: starting /etc/init.d/my_shutdown
start (1) 2392 ...<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: + case "$1" in<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: + echo 'Tue Feb 28
20:26:55 CET 2012: /etc/init.d/my_shutdown start'<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: ++ date<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: + D='Tue Feb 28 20:26:55
CET 2012'<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: + echo 'Tue Feb 28
20:26:55 CET 2012: /etc/init.d/my_shutdown start done'<br>
Feb 28 20:26:55 Linux1 my_shutdown[2392]: + logger
'/etc/init.d/my_shutdown done'<br>
Feb 28 20:26:55 Linux1 logger: /etc/init.d/my_shutdown done<br>
Feb 28 20:26:55 Linux1 sshd[1780]: Received signal 15;
terminating.<br>
Feb 28 20:26:55 Linux1 httpd2[2395]: httpd2: Could not reliably
determine the server's fully qualified domain name, using
192.168.1.27 for ServerName<br>
Feb 28 20:26:55 Linux1 ntpd[1801]: ntpd exiting on signal 15<br>
Feb 28 20:26:55 Linux1 kernel: Kernel logging (proc) stopped.<br>
Feb 28 20:26:55 Linux1 rsyslogd: [origin software="rsyslogd"
swVersion="5.8.5" x-pid="623" x-info=<a class="moz-txt-link-rfc2396E" href="http://www.rsyslog.com">"http://www.rsyslog.com"</a>]
exiting on signal 15.<br>
</blockquote>
<br>
<br>
<br>
On 27/02/12 01:49, Eduardo Tongson wrote:
<blockquote
cite="mid:CANDc0NLTuwVEbz8bf78F8fKTCxRSndzAnytBxHUbygONpxbauw@mail.gmail.com"
type="cite">
<pre wrap="">On Sun, Feb 26, 2012 at 4:24 PM, Burkhard Kayser
<a class="moz-txt-link-rfc2396E" href="mailto:kayser-b-2011@t-online.de"><kayser-b-2011@t-online.de></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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
Can please somebody point me to the right configuration?
Thanks for your help.
Regards
Burkhard
_______________________________________________
systemd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
</pre>
</blockquote>
<pre wrap="">This works consistently in my setup:
[Unit]
DefaultDependencies=no
Before=shutdown.target
[Service]
Type=oneshot
ExecStart=script
_______________________________________________
systemd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Burkhard Kayser
Im Stiegel 9
D-71549 Auenwald
Phone: +49 7191 58288
Mobile: +49 160 9136 8972
This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify me by replying to this transmission and delete the message without disclosing it. Thank you.
E-mail including attachments is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and I only send and receive emails on the basis that I am not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.</pre>
</body>
</html>