Ticket #36 (closed enhancement: fixed)
Opened 2 years ago
Last modified 2 years ago
openrc crashes if there are strange mountpoint in fstab
Reported by: | Martin Gysel <m.gysel@gmx.ch> | Owned by: | roy |
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | rc | Version: | |
Keywords: | Cc: |
Description
I had some mountpoints in my fstab which pointed to a directory which didn't exits at this time. openrc crashed...
Attachments
Change History
comment:189 Changed 2 years ago by roy
comment:193 Changed 2 years ago by Martin Gysel <m.gysel@gmx.ch>
(In reply to comment #1)
Its at the very beginning of the init. I think just after it tries to mount something based on /etc/fstab and before udev gets started. It's difficult to provide more infos because I can't log in afterwards. The error messages is something with '...mdev...' (which apears maybe 200 times). Hope that helps...
comment:202 Changed 2 years ago by roy
Could you attach your /etc/fstab please?
comment:203 Changed 2 years ago by Martin Gysel <m.gysel@gmx.ch>
/dev/sda7 / ext3 defaults,user_xattr 1 1
/dev/sda6 /boot ext3 defaults,user_xattr 1 2
/dev/sda5 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
#home
/dev/vg/home /home ext3 defaults,user_xattr 1 2
/dev/vg1/data /mnt/data ext3 defaults,user_xattr 1 2
/dev/vg/music /mnt/music ext3 defaults 1 2
#chroot stuff
/home /mnt/devel/debian/home none bind 0 0
/tmp /mnt/devel/debian/tmp none bind 0 0
/dev /mnt/devel/debian/dev none bind 0 0
/proc /mnt/devel/debian/proc proc defaults 0 0
/usr/share/fonts /mnt/devel/debian/usr/share/fonts none bind 0 0
as you see, I don't mount /mnt/devel/, so /mnt/devel/debian doesn't exist (if I mount it, it works just fine). with baselayout-1.x it wasn't a problem (just some warnings or whatever). I know this is not the normal way we use fstab but it shouldn't affect the init system as such a 'mistake' in fstab can occour
comment:205 Changed 2 years ago by roy
Does it work if you comment out the lines beginning /dev and/or /proc?
comment:209 Changed 2 years ago by Martin Gysel <m.gysel@gmx.ch>
yes, it works if the /proc line is commented
comment:210 Changed 2 years ago by roy
Created an attachment (id=15)
Change type to none
Interesting.
With your /proc line un-commented, please attach output of this commands
/lib/rc/bin/fstabinfo --quiet /proc; echo $?
Then, this patch and let me know if it works or not.
comment:211 Changed 2 years ago by Martin Gysel <m.gysel@gmx.ch>
gorilla mg # /lib/rc/bin/fstabinfo --quiet /proc; echo $?
0
also with the patch, it still doesn't work
comment:212 Changed 2 years ago by roy
OK, so fstabinfo thinks you have /proc in /etc/fstab, which is wrong.
Let's see why this maybe. Please attach output of these commands.
/lib/rc/bin/fstabinfo /proc
/lib/rc/bin/fstabinfo -b /proc
/lib/rc/bin/fstabinfo -o /proc
/lib/rc/bin/fstabinfo -p /proc
grep "/proc" /etc/fstab
cat /proc/cmdline
comment:213 Changed 2 years ago by Martin Gysel <m.gysel@gmx.ch>
gorilla mg # /lib/rc/bin/fstabinfo /proc
/proc
gorilla mg # /lib/rc/bin/fstabinfo -b /proc
proc
gorilla mg # /lib/rc/bin/fstabinfo -o /proc
defaults
gorilla mg # /lib/rc/bin/fstabinfo -p /proc
0
grep "/proc" /etc/fstab
/proc /mnt/devel/debian/proc proc defaults 0 0
proc /proc proc defaults 0 0
gorilla mg # cat /proc/cmdline
root=/dev/sda7 video=uvesafb:1024x768-32,mtrr:3,ywrap
Is I see now, I submitted a incomplete /etc/fstab, sorry for that! proc is in it...
may it be a problem that /proc which I wanna 'bind' to the chroot appears before the 'real' one?
here's the rest of my fstab :-(
...
# On this system, the next lines aren't needed, because it also works without :-)
# anyway, I'll added it...
# NOTE: The next line is critical for boot!
proc /proc proc defaults 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
comment:214 Changed 2 years ago by roy
- Status changed from new to resolved
- Resolution set to fixed
OK, I've fixed this in the git repo.
If you're using the 0.1 release, these patches should apply.
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=2ff718a144e273acbfdddfcc1459cf5ed41da17b
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=cd71d3bae21b87407b64fadfd303d50f9c5122ce
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=275b33e3a0ed7dfd9a4a5f47d71e1c73812d9368
Could you post the error message and state at what point it crashed?
Attaching an rc.log file would be helpfull