ahkok / user-session-units

A collection of units for the systemd user session.
GNU Lesser General Public License v2.1
72 stars 23 forks source link

user-session-launch@.service halts shutdown for 30 seconds #16

Closed tchebb closed 10 years ago

tchebb commented 10 years ago

I don't know enough about systemd's service-stopping logic to know why this is happening. If I manually stop user-session-launch@.service using systemctl before I shutdown, everything works as expected. The timeout only happens when the service is stopped as part of the shutdown.

Steps to reproduce:

  1. Launch a user session using user-session-launch@.service
  2. Attempt to reboot the system using systemctl --system reboot

Expected behavior: The system reboots immediately. Actual behavior: There is a 30-second delay before user-session-launch@.service times out and is killed by systemd. The corresponding user@.service quits immediately as expected.

sofar commented 10 years ago

Could be that we don't have the dependencies in order. Is there any journal entry about a service being killed at shutdown?

tchebb commented 10 years ago

Oops, I think I made a typo in the initial report. user@.service is what's getting killed, not user-session-launch@.service. Anyway, the full shutdown journalctl is here. The most relevant portion is excerpted below:

Mar 03 13:49:31 lobster systemd[583]: Stopped The Openbox window manager.
Mar 03 13:49:31 lobster systemd[583]: Unit openbox.service entered failed state.
Mar 03 13:49:31 lobster systemd[583]: Stopping The basic Xorg server.
Mar 03 13:49:31 lobster systemd[583]: Stopped target The basic Xorg server.
Mar 03 13:49:31 lobster systemd[583]: Stopping Xorg server launch helper...
Mar 03 13:49:31 lobster xorg-launch-helper[587]: (EE) Server terminated successfully (0). Closing log file.
Mar 03 13:49:31 lobster mkinitcpio[636]: ==> Build complete.
Mar 03 13:49:31 lobster systemd[1]: Started Generate shutdown-ramfs.
Mar 03 13:51:00 lobster systemd[1]: user@997.service stopping timed out. Killing.
Mar 03 13:51:00 lobster systemd[1]: Stopped User Manager for 997.
Mar 03 13:51:00 lobster systemd[1]: Unit user@997.service entered failed state.
Mar 03 13:51:00 lobster systemd[1]: Stopping user-997.slice.
Mar 03 13:51:00 lobster systemd[1]: Removed slice user-997.slice.
Mar 03 13:51:00 lobster systemd[1]: Stopping Permit User Sessions...
Mar 03 13:51:00 lobster systemd[1]: Stopped Permit User Sessions.
Mar 03 13:51:00 lobster systemd[1]: Stopping Basic System.
Mar 03 13:51:00 lobster systemd[1]: Stopped target Basic System.

Like I said, I've only been able to reproduce this timeout when running a full system shutdown. Manually stopping user-session-launch@.service, stopping user@.service, and running systemctl --user exit from within the session (in any order) produces expected results.

tchebb commented 10 years ago

I no longer see this issue after upgrading from systemd 208 to 210. Closing.