[systemd-devel] Shutdown problems

Lennart Poettering lennart at poettering.net
Fri Nov 7 03:58:23 PST 2014


On Thu, 06.11.14 19:07, Nikolaus Rath (Nikolaus at rath.org) wrote:

> Hello,
> 
> I'm having some trouble shutting down my system with systemd. What
> happens is the following:
> 
>  * If I execute "systemctl reboot" while a text console is active,
>    everything works fine.
> 
>  * If I execute "systemctl reboot" while the X11 console is active, the
>    system hangs (I tried waiting up to 7 minutes). Furthermore, I am
>    unable to switch to another console with Ctrl+Alt+Fn, the computer
>    becomes unresponsive to the keyboard and the monitor powers down.
> 
> On which tty/pty systemctl itself is executed does not matter (I tested
> this by running systemctl in an ssh session from a remote system), it
> only matters which console is currently active.
> 
> I tried the debugging technique from
> http://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1 and
> created a file debug.sh in /lib/systemd/system-shutdown with permisson
> 755 and the following contents:
> 
> $ cat /lib/systemd/system-shutdown/debug.sh 
> #!/bin/sh
> exec > /shutdown.log
> exec 2>&1
> mount -o remount,rw /
> echo stdout
> echo stderr >&2
> dmesg
> systemctl list-jobs
> systemctl status
> echo done
> mount -o remount,ro /

You open the file for writing before you actually mount the fs
read-only. That cannot work.

> However, no file /shutdown.log is created after reboot. I also tried
> placing debug.sh in /usr/lib/systemd/system-shutdown instead (this is a
> Debian system), but this did not work either.
> 
> I also tried enabling the debug-shell, but this did not help because I
> can't access tty9 when the hang occurs.
> 
> 
> I also tried running an sshd process in the debug shell (to see if I can
> still reach the system remotely when it hangs), but the connection got
> closed when I ran the systemctl command - why might that be? I had hoped
> that processes spawned from the debug-shell would not get killed?
> 
> I am using systemd 215-5+b1 on Debian jessie. I also have plymouth
> enabled.
> 
> Anyone able to help?

Please boot with "systemd.log_level=debug", then make the machine hang
and check what the last things in the logs say. Maybe then paste that
somewhere online and post the URL for that here, so that we can have a
look.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list