Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
/var stays busy at shutdown due to journald #867
Comments
|
Judging from the linked logs it fails due to EBUSY... There appears to be something still accessing the dir when we are about to go down... If you say this has been broken with systemd > 222, but not with 222, any chance you can git bisect to check which commit actually broke this? |
poettering
added
pid1
needs-reporter-feedback
labels
Aug 5, 2015
ledti
commented
Aug 10, 2015
|
I believe the bug was introduced in 7189be2. Before that commit, I can't reproduce the error message during reboot. |
|
I do see a similar problem with
I think it startet between v222 and v223, though I am not perfectly sure. |
Harv234
commented
Aug 18, 2015
|
My /var and /home are on separate partitions encrypted with dm-crypt and are also affected. Downgrading to systemd 222 fixed this for me. |
ledti
commented
Sep 2, 2015
|
I can definitely confirm that it's caused by 7189be2. Reverting that sole commit in either v224 or v225 fixes the issue for me. I used |
ram-manohar
commented
Sep 7, 2015
|
Why is this bug still tagged needs-reporter-feedback ? I am as well effected by this bug and can reproduce 100% reliably. |
Harv234
commented
Sep 9, 2015
|
Still valid in systemd 226. This is quite annoying as it affects a lot of people... See |
gnufied
commented
Sep 18, 2015
|
According to archwiki(https://wiki.archlinux.org/index.php/Fstab) each entry in |
|
@gnufied hmm? the conversion from fstab to |
gnufied
commented
Sep 18, 2015
|
Sorry, I was confused between I however see now that, users who are using encryption might be using autmounts. |
ledti
commented
Sep 18, 2015
|
I'm not sure. If automount units are something unrelated to fstab, then no. I only use /etc/fstab.
Here's my current fstab. Besides root, /boot, and /home, I only have one other partition (sdb1) that is auto-mounted at boot. It's on a separate internal hard drive. |
flannelhead
commented
Sep 22, 2015
|
No automounts here either, but I'm also seeing these failures. They don't happen on every shutdown, but unmounting It seems systemd starts unmounting remaining mounts too early on shutdown. This can particularly affect user services like
|
graysky2
commented
Sep 23, 2015
|
I too have a problem with /var/log using v226 on Arch.
I will revert 7189be2 and report back here. Building systemd from ABS inserting the patch in the prepare function: Where revert.patch = https://github.com/systemd/systemd/commit/7189be2728ae2926500371cda6f13f9cdc06c21b.patch |
ggg377
commented
Sep 23, 2015
|
I have a similar, but so far unique error on shutdown since the latest systemd upgrade. This can be reproduced on a fresh Arch Linux install with full dm-crypt LUKS encryption:
I can also confirm the /run/user/1000 unmounting errors on shutdown and if I add my cache folder into tmpfs via fstab, then that also fails to unmount occasionally. The latest systemd release also causes data loss when used with profile-sync-daemon with overlayfs on. None of this happened before 226. |
atmouse-
commented
Sep 29, 2015
|
You can logout all users, then use powerbutton to shutdown. bypassing this issue :) |
flannelhead
commented
Sep 29, 2015
|
@atmouse- That's not completely true, as some people are seeing this issue with other that user mounts, like |
graysky2
commented
Sep 29, 2015
|
Reverting this commit has not solved my problem. |
ledti
commented
Oct 8, 2015
|
Since upgrading to 227, I haven't been able to reproduce this bug. |
flannelhead
commented
Oct 8, 2015
|
@ledti I can confirm that. Been running systemd 227 since yesterday. There have been several reboots with normal usage between them, and the error hasn't appeared a single time. I've checked the journals from all the shutdowns, and the unmounting race conditions I described above don't seem to appear any more. |
Harv234
commented
Oct 8, 2015
|
The error 'Failed unmounting /var/log' still persists with systemd 227. Seems it does not like /var on a separate partition encrypted via luks decrypted via /etc/crypttab (UUID) and mounted via /etc/fstab (/dev/mapper/var). |
cryptoluks
commented
Oct 12, 2015
|
@ledti I can confirm that too. No errors since systemd 227. |
|
I still see |
Harv234
commented
Oct 15, 2015
|
This is interesting. We saw this error before, IIRC... The workaround was to specify Storage=volatile in /etc/systemd/journald.conf. But this time this does not help. |
|
|
Harv234
commented
Oct 15, 2015
|
Yes, I know that. As I said, it was only a workaround. And it does not work anymore, although /var/log is not used in this case. BTW, my error says: "error unmounting /var", not "/var/log". Hmmm. Relevant? |
|
There are two issues being intermingled here...
Anyway, i will now rename this one, and make this strictly about issue 2 above, as issue 1 should be fixed. |
poettering
changed the title from
" Failed unmounting /run/user/1000; Failed unmounting /home " on systemd > 222
to
/var stays busy at shutdown due to journald
Oct 15, 2015
poettering
added
journal
and removed
needs-reporter-feedback
labels
Oct 15, 2015
wkennington
referenced this issue
in NixOS/nixpkgs
Nov 16, 2015
Closed
Systemd 227 Failing to unmount during shutdown / reboot #11059
genodeftest
commented
Jan 26, 2016
|
See also this downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=1026119 |
|
This bug probably only affects separated partitions which are encrypted. |
graysky2
commented
Jan 26, 2016
No, I have a simple bind mount in my fstab and I experience it:
|
lynxthecat
commented
Mar 30, 2016
|
Is this being looked into? Just set up separate /var partition and now receive the disconcerting failed unmount message on system shutdown. This is using Archlinux. |
ganthore
commented
Apr 11, 2016
|
Same issue occurs using a separate encrypted partition that is auto-mounted at boot time via the fstab. In my case it's the /home folder. Going try and workaround the problem by using autofs since I was meaning to get that entry out of the fstab, but not sure if that will really matter. The host OS is running Gentoo w/ systemd-229. |
evverx
referenced this issue
May 9, 2016
Merged
Some small fixes to make it easier to run tests and fix failure in TEST-{02,08} #3222
pklapperich
commented
Jun 17, 2016
•
|
On a live system I can Presumably systemd shuts down journald and associated sockets before the system is actually rebooted. Couldn't umounting |
user501254
commented
Sep 28, 2016
|
Same issue on Fedora 24. |
|
If you add
to systemd-journald.service, does the error message go away? |
genodeftest
commented
Sep 28, 2016
•
|
Yes, adding |
|
Replying to myself: Adding the RequiresMountsFor=/var/log/journal to systemd-journald.service has a couple of unpleasant side-effects
So I'm a bit undecided whether adding RequiresMountsFor would actually be a good idea @poettering Could we simply exclude any mounts below /var from being unmounted via Conflicts=umount.target? |
|
Excluding /var from being umounted via umount.target should be as simple as adding it to
|
|
@mbiebl see my earlier comments. THis is a known issue, and we are unlikely to fix this anytime soon, as journald keeps /var/log/journal busy, but needs to stay around until the last moment of shutdown so that it collects logs. The only way to fix this properly would be to add a way to tell the journal to move its logs from /var back to /run at some time before shutting down, and only then trying to unmount /var. This would be the inverse of systemd-journal-flush.service which triggers the move /run → /var at boot. Implementing this isn't trivial however, as the move operation at shutdown needs to be synchronous to be safe, and thus a plain unix signal is not enough. Ideally we'd just add a bus call to journald for this, but we can't due to the weird relationship between the journal and dbus-daemon: as dbus-daemon logs to journald the latter can't also be client to the former, to avoid deadlocks. I see no easy fix for the moment. That said, the issue is purely cosmetic IRL. The final killing spree (where journald is finally gone) will be able to unmoiunt /var anyway, hence the earlier umount failing might be annoying but isn't much of an issue. |
|
@poettering Why this complex logic on shutdown? If we move journald to ephemeral storage, the log messages will be lost, so we could just as well stop journald |
|
@mbiebl I am pretty sure we should collect logs all the way through the end, even if we have to store them on tmpfs during late shutdown and thus lose them on reboot. That#s because we won't lose them until the actual physical reboot happens, hence if you are trying to debug stuff, then you can still do so in some final debugging shell, for example in the initrd shutdown hooks, or just from the /etc/halt script thingy. |
rathann
commented
Jan 18, 2017
|
I'm also affected by this, having separate /var LV on a LUKS-encrypted VG. @mbiebl thanks for the work-around. It works exactly as you described. |
genodeftest
commented
Jan 18, 2017
•
|
In reference to #867 (comment) by @mbiebl of adding |
This was referenced Jan 18, 2017
hlaube1
commented
Nov 1, 2017
|
Adding RequiresMountsFor=/var/log/journal to systemd-journald.service helped here as well. Shutdown no runs the laptop completly down. |
dunca commentedAug 5, 2015
Hello.
It's been happening when shutting down or rebooting. It doesn't seem to happen with systemd 222.
More info: https://bbs.archlinux.org/viewtopic.php?id=200469