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

init.sh.patch Download (0 bytes) - added by roy 2 years ago.
Change type to none

Change History

comment:189 Changed 2 years ago by roy

Could you post the error message and state at what point it crashed?
Attaching an rc.log file would be helpfull

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

Changed 2 years ago by roy

Change type to none

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

Note: See TracTickets for help on using tickets.