[systemd-devel] customized shutdown service needed
Reindl Harald
h.reindl at thelounge.net
Wed Feb 29 03:51:34 PST 2012
well, but it does not help
i have this since months
maybe the stoneold version in Fedora 15 is the problem
other possible reason:
the script starts serveral "vmrun"-processes to suspend
the virtual machines and systemd is killing this
processes during shutdown
next possible reason:
the script is started but "vmware.service" is stopped
asynchron leading in killing the prcoesses while suspend
no idea, it simply does not work to reboot/shutdown a
machine running F15/systemd without damage running
VMware guests
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
Am 29.02.2012 09:18, schrieb Manuel Amador:
> The key thing is the TimeoutSec. without that, systemd just gives up after a few seconds and SIGKILLs everything.
>
> On Tuesday, February 28, 2012 20:37:14 Burkhard Kayser wrote:
>
> Hi
> I tried as well the following configuration. My script shall be started before ANY other service is shut down.
> Stopping a virtual machine is only one example. Synchronizing data into a truecrypt container another.
>
>
> [Unit]
> Description=my shutdown service
>
> Before=shutdown.service halt.service shutdown.target umount.target
> DefaultDependencies=no
>
> [Service]
> ExecStart=/etc/init.d/my_shutdown start
> Type=oneshot
> RemainAfterExit=true
> TimeoutSec=600
>
> [Install]
> WantedBy=shutdown.target
>
>
>
> My script is started almost at the end of the shutdown sequence. See var/log/messages below.
>
>
> Feb 28 20:26:54 Linux1 systemd[1]: alsa-store.service: main process exited, code=exited, status=19
> Feb 28 20:26:54 Linux1 systemd[1]: Unit alsa-store.service entered failed state.
> Feb 28 20:26:54 Linux1 sshd[2233]: Exiting on signal 15
> Feb 28 20:26:54 Linux1 alsactl[2391]: /usr/sbin/alsactl: save_state:1519: No soundcards found...
> Feb 28 20:26:54 Linux1 haveged: haveged stopping due to signal 15
> Feb 28 20:26:54 Linux1 umount[2374]: umount: /var/lib/nfs/rpc_pipefs: device is busy.
> Feb 28 20:26:54 Linux1 umount[2374]: (In some cases useful info about processes that use
> Feb 28 20:26:54 Linux1 avahi-daemon[652]: avahi-daemon 0.6.30 exiting.
> Feb 28 20:26:54 Linux1 umount[2374]: the device is found by lsof(8) or fuser(1))
> Feb 28 20:26:54 Linux1 systemd[1]: var-lib-nfs-rpc_pipefs.mount mount process exited, code=exited status=1
> Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-etc.mount entered failed state.
> Feb 28 20:26:55 Linux1 systemd[1]: Unit srv-mywiki.mount entered failed state.
> Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-tmp.mount entered failed state.
> Feb 28 20:26:55 Linux1 systemd[1]: Unit mnt-Server-Download.mount entered failed state.
> Feb 28 20:26:55 Linux1 logger: starting /etc/init.d/my_shutdown start (1) 2392 ...
> Feb 28 20:26:55 Linux1 my_shutdown[2392]: + case "$1" in
> Feb 28 20:26:55 Linux1 my_shutdown[2392]: + echo 'Tue Feb 28 20:26:55 CET 2012: /etc/init.d/my_shutdown start'
> Feb 28 20:26:55 Linux1 my_shutdown[2392]: ++ date
> Feb 28 20:26:55 Linux1 my_shutdown[2392]: + D='Tue Feb 28 20:26:55 CET 2012'
> 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'
> Feb 28 20:26:55 Linux1 my_shutdown[2392]: + logger '/etc/init.d/my_shutdown done'
> Feb 28 20:26:55 Linux1 logger: /etc/init.d/my_shutdown done
> Feb 28 20:26:55 Linux1 sshd[1780]: Received signal 15; terminating.
> 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
> Feb 28 20:26:55 Linux1 ntpd[1801]: ntpd exiting on signal 15
> Feb 28 20:26:55 Linux1 kernel: Kernel logging (proc) stopped.
> Feb 28 20:26:55 Linux1 rsyslogd: [origin software="rsyslogd" swVersion="5.8.5" x-pid="623"
> x-info="http://www.rsyslog.com"] exiting on signal 15.
>
>
>
> On 27/02/12 01:49, Eduardo Tongson wrote:
>
> On Sun, Feb 26, 2012 at 4:24 PM, Burkhard Kayser
>
> <kayser-b-2011 at t-online.de> <mailto:kayser-b-2011 at 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.
>
>
> 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
>
> systemd-devel at lists.freedesktop.org <mailto:systemd-devel at lists.freedesktop.org>
>
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
>
> This works consistently in my setup:
>
>
> [Unit]
>
> DefaultDependencies=no
>
> Before=shutdown.target
>
>
> [Service]
>
> Type=oneshot
>
> ExecStart=script
>
> _______________________________________________
>
> systemd-devel mailing list
>
> systemd-devel at lists.freedesktop.org <mailto:systemd-devel at lists.freedesktop.org>
>
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
> --
>
> 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.
>
>
>
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/
http://www.thelounge.net/signature.asc.what.htm
-------------- 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/20120229/f8532939/attachment.pgp>
More information about the systemd-devel
mailing list