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

systemd 227 and /etc/mtab being a regular file #4

Closed
haste opened this issue Nov 10, 2015 · 1 comment
Closed

systemd 227 and /etc/mtab being a regular file #4

haste opened this issue Nov 10, 2015 · 1 comment

Comments

@haste
Copy link

haste commented Nov 10, 2015

systemd 227[0] enforces that /etc/mtab isn't a regular file and freezes the system during boot if it is. This is only a temporary issue as the behavior is patched[1] away in the next version of systemd.

A temporary workaround is to create a symlink instead in init.drbl:

diff --git a/setup/files/misc/init.drbl b/setup/files/misc/init.drbl
index 73ea98a..f8e5e8d 100755
--- a/setup/files/misc/init.drbl
+++ b/setup/files/misc/init.drbl
@@ -352,11 +352,7 @@ maybe_break drbl_postnfs
 rm -f /etc/mtab /etc/mtab~ /etc/mtab~~ /etc/nologin

 # if, for any reason, mtab was not synced with what it should be, Sync it.
-while read ilist; do
-  # skip the "rootfs / rootfs rw 0 0" 
-  [ -n "$(echo $ilist | grep -E "^rootfs \/ rootfs .*")" ] && continue
-  echo $ilist >> /etc/mtab
-done < /proc/mounts
+ln -sf /proc/mounts /etc/mtab

 # umount the useless /initrd/proc and /initrd if they exist.
 for i in /initrd/proc /initrd; do

I'm not familiar enough with the internals to know if this creates any issues (due to rootfs not being removed), but it works in our current setup.

systemd 227 is currently used in Debian Stretch and Sid.

[0] http://lists.freedesktop.org/archives/systemd-devel/2015-October/034509.html
[1] systemd/systemd@5dea1c1

stevenshiau added a commit that referenced this issue Nov 21, 2015
Systemd v227 enforces /etc/mtab as a link file otherwise system will be
freezed. Thanks to haste for providing the patch.
(#4)
@stevenshiau
Copy link
Owner

Forgot to mention this patch has been applied 2 weeks ago.
Thanks.

Steven.

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

No branches or pull requests

2 participants