Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't unmount /tmp with recent systemd version #6350

Closed
mcloaked opened this issue Jul 12, 2017 · 2 comments
Closed

Can't unmount /tmp with recent systemd version #6350

mcloaked opened this issue Jul 12, 2017 · 2 comments

Comments

@mcloaked
Copy link

Submission type

  • Bug report

systemd version the issue has been seen with

systemd 233.75-3

Used distribution

Arch Linux

In case of bug report: Expected behaviour you didn't see

on shutdown /tmp should unmount without errors

In case of bug report: Unexpected behaviour you saw

Red "Failed" line during shutdown saying "Failed unmounting Temporary Directory."

The system log shows:
...
Jul 10 16:20:20 lenovo2 systemd[1]: Unmounting Temporary Directory...
Jul 10 16:20:20 lenovo2 systemd[1]: Unmounting /run/user/994...
Jul 10 16:20:20 lenovo2 systemd[1]: Unmounting /home...
Jul 10 16:20:20 lenovo2 systemd[1]: Unmounting /boot/efi...
Jul 10 16:20:20 lenovo2 systemd[1]: tmp.mount: Mount process exited, code=exited status=32
Jul 10 16:20:20 lenovo2 systemd[1]: Failed unmounting Temporary Directory.
Jul 10 16:20:20 lenovo2 systemd[1]: Stopped target Swap.
...

The /tmp contained:
$ ls /tmp
akonadi-mike.QYDQ0o checkup-db-mike sddm-:0-DZZtLD sddm-auth98525ba4-cf6c-40fb-bde3-0ac8a034738e ssh-jn3oR5dPmtq2 xauth-1000-_0

On a second laptop with different hardware also running arch linux fully up to date I tried to manually unmount /tmp with the result:

$ sudo systemctl stop tmp.mount
Job for tmp.mount failed.
See "systemctl status tmp.mount" and "journalctl -xe" for details.
$ systemctl status tmp.mount
● tmp.mount - Temporary Directory
Loaded: loaded (/usr/lib/systemd/system/tmp.mount; static; vendor preset: disabled)
Active: active (mounted) (Result: exit-code) since Wed 2017-07-12 20:33:38 BST; 22s ago
Where: /tmp
What: tmpfs
Docs: man:hier(7)
http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
Process: 15162 ExecUnmount=/usr/bin/umount /tmp -c (code=exited, status=32)
Process: 306 ExecMount=/usr/bin/mount tmpfs /tmp -t tmpfs -o mode=1777,strictatime,nosuid,nodev (code=exited, status=32)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/tmp.mount

Jul 12 20:32:17 lenovo1 systemd[1]: Mounting Temporary Directory...
Jul 12 20:32:17 lenovo1 systemd[1]: Mounted Temporary Directory.
Jul 12 20:33:38 lenovo1 systemd[1]: Unmounting Temporary Directory...
Jul 12 20:33:38 lenovo1 systemd[1]: tmp.mount: Mount process exited, code=exited status=32
Jul 12 20:33:38 lenovo1 systemd[1]: Failed unmounting Temporary Directory.

$ sudo journalctl -xe
...
-- Unit tmp.mount has begun shutting down.
Jul 12 20:33:38 lenovo1 systemd[1]: tmp.mount: Mount process exited, code=exited status=32
Jul 12 20:33:38 lenovo1 systemd[1]: Failed unmounting Temporary Directory.
-- Subject: Unit tmp.mount has finished shutting down
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit tmp.mount has finished shutting down.
...

/tmp remains mounted after this. On this machine shutting down also gives the failure to unmount temporary directory during the shutdown process. This has only started with recent versions of systemd.

In case of bug report: Steps to reproduce the problem

Simply boot the machine, login to the plasma desktop and logout and shutdown - during the shutdown there is a red Fail line when the system cannot unmount the temporary directory.

@mcloaked
Copy link
Author

It turned out that there was an ssh-agent process in /tmp still running that prevented the unmounting of /tmp - presumably since this didn't use to happen that systemd is now fussier about user processes still running at the time it attempts unmount during shutdown. I will investigate my own scripts that I use to set up the ssh-agent and close this issue.

@LinuxOnTheDesktop
Copy link

I have the same problem and my machine has no self-written scripts that concern ssh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants