Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73536 - mount handling in /sbin/rc breaks system startup
Summary: mount handling in /sbin/rc breaks system startup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 73762 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-06 02:12 UTC by Christian Roessner
Modified: 2004-12-11 09:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/fstab with chroot jail entries (fstab,1.16 KB, text/plain)
2004-12-06 06:37 UTC, Christian Roessner
Details
/etc/fstab with chroot jail entries (fstab,1.75 KB, text/plain)
2004-12-06 06:48 UTC, Christian Roessner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Roessner 2004-12-06 02:12:23 UTC
With baselayout 1.11.7-r2 the system does not startup anymore, because I have some special entries in /etc/fstab:

# chroot-jail
/dev                    /chroot32/dev                           none    bind            0 0
/tmp                    /chroot32/tmp                           none    bind            0 0
/var/tmp                /chroot32/var/tmp                       none    bind            0 0
/home/croessner /chroot32/home/croessner        none    bind            0 0
/root                   /chroot32/root                          none    bind            0 0
/usr/portage    /chroot32/usr/portage           none    bind            0 0
/proc                   /chroot32/proc                          none    bind            0 0
/sys                    /chroot32/sys                           none    bind            0 0

These entries are required, if you want to use a 32 bit chroot jail inside 64bit native gentoo. Unfortunaly the new /sbin/rc will fail in startup handling. Removing these entries in /etc/fstab, the system starts up again.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.

Actual Results:  
After detecting udev and trying it to mount it to /dev, I get an error that awk
would not find /proc/filesystems.


Expected Results:  
Normally, after udev was taken, there should be a line showing Using hotplug as
bla bla agent or something like this. But this does not appear.

Gentoo Base System version 1.6.7
Portage 2.0.51-r8 (default-linux/amd64/2004.3, gcc-3.4.3,
glibc-2.3.4.20040808-r1, 2.6.9 x86_64)
=================================================================
System uname: 2.6.9 x86_64 AMD Athlon(tm) 64 Processor 3200+
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jun  5 2004, 10:14:22)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.9.3, 1.6.3, 1.7.9
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.6.8.1-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE=""
ALSA_CARDS="intel8x0 emu10k1"
ARCH="amd64"
AUTOCLEAN="yes"
AUTO_SYMLINK="no"
BASH_ENV="/etc/spork/is/not/valid/profile.env"
CFLAGS="-O1 -march=athlon64 -pipe -fcaller-saves -fpeephole2 -falign-loops
-falign-jumps -finline-functions -fweb -fr
educe-all-givs -funroll-all-loops -ffinite-math-only -fno-signaling-nans
-fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CLASSPATH="."
CLEAN_DELAY="5"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/k
de/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /usr/share/texmf/dvipdfm/con
fig/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/sha
re/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CONF_LIBDIR="lib"
CONF_MULTILIBDIR="lib32"
CVS_RSH="ssh"
CXXFLAGS="-O1 -march=athlon64 -pipe -fno-merge-constants -fno-defer-pop
-fno-thread-jumps -fcse-follow-jumps -fgcse -
fpeephole2 -fschedule-insns2 -fregmove -ffloat-store -ftracer -funroll-all-loops
-ffinite-math-only -fno-signaling-na
ns -fomit-frame-pointer"
DCCC_PATH="/usr/lib/distcc/bin"
DISPLAY=":0.0"
DISTCC_LOG=""
DISTCC_VERBOSE="0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/vim"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P ${DISTDIR} ${URI}"
GDK_USE_XFT="1"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp:
//ftp.gentoo.mesh-solutions.com/gentoo/ http://gentoo.inode.at/"
GRP_STAGE23_USE="multilib ipv6 pam tcpd readline nls ssl gpm perl python berkdb
ncurses readline zlib -java -nptl"
G_BROKEN_FILENAMES="1"
HISTCONTROL="ignoredups:erasedups"
HOME="/root"
HOSTNAME="amd64"
INFOPATH="/usr/share/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.3/info"
JAVAC="/opt/blackdown-jdk-1.4.2.01/bin/javac"
JAVA_HOME="/opt/blackdown-jdk-1.4.2.01"
JDK_HOME="/opt/blackdown-jdk-1.4.2.01"
KBUILD_OUTPUT_PREFIX=""
KDEDIR="/usr/kde/3.3"
KDEDIRS="/usr"
KDE_MALLOC="1"
LANG="de_DE@euro"
LANGUAGE="de"
LC_CTYPE="de_DE@euro"
LESS="-R"
LESSOPEN="|lesspipe.sh %s"
LINGUAS="de"
LINUX_PORTAGE_WRITABLE="no"
LOGNAME="root"
LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;3
7;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01
;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;3
1:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=
01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.
xcf=01;35:*.pcx=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.avi=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;3
5:*.mp4v=01;35:*.mov=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.fli=01;35:*.gl=01
;35:*.dl=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.mp3=00;36:*.wav=00;36:*.mid=0
0;36:*.midi=00;36:*.au=00;36:*.ogg=00;36:"
MAIL="/var/mail/root"
MAKEOPTS="-j4"
MANPATH="/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.3/man:/usr/share/man::/opt/b
lackdown-jdk-1.4.2.01/man:/usr/qt/3/doc/man"
MOZILLA_FIVE_HOME="/usr/lib/mozilla"
NOCOLOR="false"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.3:/u
sr/X11R6/bin:/opt/blackdown-jdk-1.4.2.01/bin:/opt/blackdown-jdk-1.4.2.01/jre/bin:/usr/qt/3/bin:/usr/kde/3.3/sbin:/usr
/kde/3.3/bin"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 ppc-macos ppc-od
s390 sh sparc x86 x86-obsd x86-fbsd
x86-od"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_CALLER="emerge"
PORTAGE_GID="250"
PORTAGE_MASTER_PID="20146"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
PORT_LOGDIR="/var/log/portage"
PRELINK_PATH=""
PRELINK_PATH_MASK="/usr/lib/wine:/usr/lib/valgrind"
PWD="/root"
PYTHONDOCS="/usr/share/doc/python-docs-2.3.4/html"
QMAKESPEC="linux-g++"
QTDIR="/usr/qt/3"
RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P ${DISTDIR} ${URI}"
RPMDIR="/usr/portage/rpm"
RSYNC_RETRIES="3"
RSYNC_TIMEOUT="180"
SANE_CONFIG_DIR="/etc/sane.d"
SHELL="/bin/bash"
SHLVL="1"
SSH_AGENT_PID="19586"
SSH_AUTH_SOCK="/tmp/ssh-jzyIs19585/agent.19585"
STAGE1_USE="multilib"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
TERM="xterm"
USE="amd64 X aalib acl acpi activefilter adns alsa arts artswrappersuid avi
berkdb bitmap-fonts bonobo cdparanoia cdr
 crypt cups dhcp directfb dnsdb doc dvd dvdr encode exiscan exiscan-acl f77 faad
fam fbcon flac foomaticdb gdbm gif g
impprint gnome gpm gstreamer gtk2 gtkhtml imagemagick imlib ipv6 javascript jp2
jpeg kde lcd ldap libwww lm_sensors l
mtp lzw lzw-tiff mad mailwrapper mbox mcal mikmod motif mozilla mppe-mppc mysql
nas ncurses nls odbc oggvorbis opengl
 oss pam pdflib perl png pnp ppds python qt quicktime readline samba scanner sdl
slang slp snmp spell ssl tcpd tetex
tiff truetype unicode usb userlocales vim-with-x wxwindows xml xml2 xmms xosd
xpm xprint xrandr xv zlib linguas_de"
USER="root"
USERLAND="GNU"
USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS"
XARGS="xargs -r"
XAUTHORITY="/root/.xauthHbzf56"
XINITRC="/etc/X11/xinit/xinitrc"
_="/usr/bin/emerge"
ftp_proxy="http://192.168.0.1:3128/"
http_proxy="http://192.168.0.1:3128/"
Comment 1 SpanKY gentoo-dev 2004-12-06 06:14:44 UTC
attach your /etc/fstab
Comment 2 Christian Roessner 2004-12-06 06:37:25 UTC
Created attachment 45382 [details]
/etc/fstab with chroot jail entries

/etc/fstab contains all the entries, which will break a normal boot process.
Comment 3 Christian Roessner 2004-12-06 06:48:46 UTC
Created attachment 45383 [details]
/etc/fstab with chroot jail entries

I put the wron fstab first. So this is the one I meant.
Comment 4 SpanKY gentoo-dev 2004-12-06 07:41:06 UTC
could you try this patch ?  it's for /sbin/functions.sh
http://bugs.gentoo.org/attachment.cgi?id=45370&action=view
Comment 5 Christian Roessner 2004-12-06 08:11:02 UTC
This did NOT fix the problem. Sorry.

Here is what is visible at startup:

* Mounting proc at /proc [ ok ]
* Mounting sysfs at /sys [ ok ]
* Mounting /dev for udev [ok ]
* Configuring system to use udev ...
awk: cmd. line: 2: fatal: cannot open fil '/proc/filesystems' for reading (No such file or directory)
* Activating (possible) swap [ ok ]
/sbin/functions.sh: line 72: /proc/cmdline No such file or directory
* Remounting filesystem read-only (if necessary)
* Checking root filesystem
fsck.ext2: No such file or directory while trying to open /dev/hdb3
...
* filesystem couldn
Comment 6 Christian Roessner 2004-12-06 08:11:02 UTC
This did NOT fix the problem. Sorry.

Here is what is visible at startup:

* Mounting proc at /proc [ ok ]
* Mounting sysfs at /sys [ ok ]
* Mounting /dev for udev [ok ]
* Configuring system to use udev ...
awk: cmd. line: 2: fatal: cannot open fil '/proc/filesystems' for reading (No such file or directory)
* Activating (possible) swap [ ok ]
/sbin/functions.sh: line 72: /proc/cmdline No such file or directory
* Remounting filesystem read-only (if necessary)
* Checking root filesystem
fsck.ext2: No such file or directory while trying to open /dev/hdb3
...
* filesystem couldn´t be fixed [ !! ]
Comment 7 SpanKY gentoo-dev 2004-12-06 08:49:39 UTC
seems to be a bug in util-linux's mount ?

change your chroot32 entries to have a trailing /:
/proc/   /chroot32/proc ...
/sys/    /chroot32/sys ...

that should fix your box
Comment 8 Christian Roessner 2004-12-06 09:00:06 UTC
Thanks. That works. But I guess it is not the cleanest way, isn
Comment 9 Christian Roessner 2004-12-06 09:00:06 UTC
Thanks. That works. But I guess it is not the cleanest way, isn´t it?
Comment 10 SpanKY gentoo-dev 2004-12-06 10:10:01 UTC
no, but it may be our only way

add a note to /etc/fstab that '/proc', '/dev', and '/sys' entries are special

the `mount [dev | dir]` format will always look at the last entry in /etc/fstab and in your case, the chroot32 proc took precedence over the real /proc

i'll add some comments to /etc/fstab ... any other thoughts to help users not fall into this same situation ?
Comment 11 SpanKY gentoo-dev 2004-12-06 10:17:15 UTC
we could make it an option in /etc/conf.d/rc perhaps ...

RC_USE_FSTAB and set the default to 0 so that users have to enable this feature (and in which case we can easily tell them to fix their own fstab) ?
Comment 12 Christian Roessner 2004-12-06 10:25:13 UTC
But maybe "awk" could also look for the right column inside fstab. I mean looking explicitly for the mount-point and not only for the existens in the while file.

This would be the 2nd column.
Comment 13 Christian Roessner 2004-12-06 10:31:16 UTC
Something like:
egrep "\n" /etc/fstab | egrep -v "^#" | awk '{ print $2; }'
Comment 14 Christian Roessner 2004-12-06 10:38:36 UTC
Examples:

croessner@amd64 ~ $ export mountpoint=/proc
croessner@amd64 ~ $ egrep "\n" /etc/fstab | egrep -v "^#" | awk '{ print $2; }' | egrep "^$mountpoint.*$"
/proc
croessner@amd64 ~ $ export mountpoint=/chroot32/home/croe
croessner@amd64 ~ $ egrep "\n" /etc/fstab | egrep -v "^#" | awk '{ print $2; }' | egrep "^$mountpoint.*$"
/chroot32/home/croessner
Comment 15 SpanKY gentoo-dev 2004-12-06 13:00:57 UTC
it's not an issue with the awk statement, it's an issue with mount

you have two entries with /proc ... the first uses '/proc' as the mount point while the second uses it as the 'device'

the `mount [dev | dir]` syntax provides no way of saying the arg you're passing is a device or a directory, so in this way, mount matches both fstab entries but uses the last one found (in this case your chroot32 one)

the mount statement that is used in /sbin/rc is simply `mount -n /proc`
Comment 16 SpanKY gentoo-dev 2004-12-08 10:42:16 UTC
*** Bug 73762 has been marked as a duplicate of this bug. ***
Comment 17 SpanKY gentoo-dev 2004-12-08 15:37:39 UTC
could you try this patch please ?
http://bugs.gentoo.org/attachment.cgi?id=45575
Comment 18 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-10 22:15:23 UTC
the patch worked.
Comment 19 SpanKY gentoo-dev 2004-12-11 09:22:31 UTC
added to stable rc-scripts