Bug#759320: systemd fails to close user sessions with nonexistent home (nobody)

Michael Biebl biebl at debian.org
Tue Aug 26 09:27:42 BST 2014


tags 759320 + confirmed
thanks

Am 26.08.2014 10:20, schrieb Nicolas George:
> 
> If a session was opened for user nobody, or probably any user with a
> nonexistent home directory:
> 

[..]

> 
> Then stopping the session fails:
> 
> Aug 26 09:54:12 aimlin systemd[2719]: Failed at step CHDIR spawning /bin/kill: No such file or directory
> Aug 26 09:54:12 aimlin systemd[1353]: systemd-exit.service: main process exited, code=exited, status=200/CHDIR
> Aug 26 09:54:12 aimlin systemd[1353]: Failed to start Exit the Session.
> Aug 26 09:54:12 aimlin systemd[1353]: Dependency failed for Exit the Session.
> Aug 26 09:54:12 aimlin systemd[1353]: Unit systemd-exit.service entered failed state.
> 
> That causes a 60 seconds timeout, making it seem shutdown is stuck.

IIRC the timout here is 90 seconds.

> The problem is that "step CHDIR" tries to chdir to the nonexistent home
> directory, and considers the failure as fatal.
> 
> AFAICS, the corresponding code is the same for the version currently in
> experimental (214-1) and in upstream's Git head. See the second instance of
> EXIT_CHDIR in src/core/execute.c and the only instance of get_home_dir() in
> src/core/unit.c.

I guess that should be easy to verify.

> I suppose the same issue could arise in other circumstances than opening a
> session for an invalid user, maybe with network-shared home directories
> temporarily unavailable. I do not have the infrastructure to test further.

Right, I e.g. noticed this issue when popularity-contest is installed
and enabled. The /etc/cron.daily/popularity-contest then runs
  su -s /bin/sh -c "/usr/sbin/popularity-contest" nobody
which also creates such a systemd session which blocks shutdown.





-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20140826/fb2a2236/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list