[systemd-devel] Fwd: systemd: wait for shutdown-service to complete

Lennart Poettering lennart at poettering.net
Fri Dec 16 08:09:03 PST 2011


On Fri, 16.12.11 13:41, Reindl Harald (h.reindl at thelounge.net) wrote:

> there must be some bug in Fedora 15 systemd
> "systectl start/stop vmware-default.service" works perfectly
> 
> but at shutdown systemd will not wait until it is finished
> before the sysv-service "vmware-service" is terminated
> what results in hard-powered-off guests and fschecks in most
> guests starting the host the next time :-(
> 
> [root at rh:~]$ 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

Instead of "su" just use User=vmware...

> ExecStop=/scripts/vmware/vm-suspend-all.sh
> RemainAfterExit=yes
> TimeoutSec=600
> SysVStartPriority=90

This is usually not what you want...

To debug problems during shutdown it is usually a good idea to enable
debug logging (systemd.log_level=debug systemd.log_target=kmsg
log_buf_len=2M). If you need to record the log mesages before the
machine powers off, drop a
tiny shell script into /lib/systemd/system-shutdown/, mark it executable:

#!/bin/sh
mount / -orw,remount
dmesg > /shutdown.dmesg
mount / -oro,remount

Then, when you shut down the file /shutdown.dmesg wil be generated with
all log output from kmsg, which should give you hint what systemd is
doing. When you cannot make sense of it, paste it somewhere and post the
url, and I'll see what I can make of it.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list