Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184773 - if inittab invokes `rc` with something other than "default", softlevel is ignored
Summary: if inittab invokes `rc` with something other than "default", softlevel is ign...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-09 20:47 UTC by Nicolas Sebrecht
Modified: 2007-07-10 17:14 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Sebrecht 2007-07-09 20:47:13 UTC
The system always boot into the runlevel defined in inittab. The kernel parameter to give a predefined runlevel is skipped.

Reproducible: Always

Steps to Reproduce:
1. Unknown.
2.
3.

Actual Results:  
Runlevel is fixed in grub like this (I tried more solutions, you can find more information in additional section):
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=default
When the default runlevel in inittab is changed, then the system boot into it.

For example, if the initdefault is:
id:4:initdefault:
And the boot line in grub is:
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=default
(corresponding to the 3th INIT runlevel, the system still boot up on the 4th (ethernet) runlevel.



Portage 2.1.2.7 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 mobile AMD Athlon (tm) 1400+
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 22 Jun 2007 21:00:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -s"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon-xp -pipe -s"
DISTDIR="/mnt/lacie/gnu-linux/distributions/gentoo/distfiles"
FEATURES="candy cvs distlocks metadata-transfer sandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.modulix.net/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gentoo.tiscali.nl/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_FR.utf8"
LC_ALL="fr_FR.utf8"
LINGUAS="en-US en_GB fr_FR fr"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac aalib ace acpi adns aim alsa amarok amuled ao arj asf audiofile bash-completion berkdb bidi bindist binfilter bitmap-fonts bl bonjour bonobo branding bzip2 caps cdparanoia cdr cjk clamav cli colordiff console cracklib crypt css cups cvs cvsgraph dbus devhelp dga dio divx djvu dmi dri dts dv dvb dvd dvdread emacs emacs-w3 emerald enca encode enscript epson escreen esd exif fam fame fat fbcon ffmpeg filepro firefox flac font-server foomaticdb fortran fpx ftp gaim gb gcj gdb gdbm ggi gif gimp gimpprint glib glut gmail gmedia gmp gnome gnome-print gnomedb gnutella gphoto2 gpm graphlcd gs gstreamer gtk gtk2 gtkhtml guionly hal hardened hardenedphp hpn html iconv icq id3 idn image imagemagick imap imlib isdnlog jabber jad java javascript jbig jpeg jpeg2k lame lcms leim libcaca libg++ libgda libnotify libwww lm_sensors lzo lzw mad magica maildir math matroska mbox mcal mcve md5sum mdb midi mikmod milter mime mjpeg mmap mmx mmxext mng mod modplug motif mozilla mp3 mpeg mpi mplayer msn mudflap mysql mysqli nas ncurses network nfs nls nntp no-seamonkey nodrm nptl nptlonly nsplugin odbc ofx ogg openal opengl openmp osc oscar pam pch pcre pdf perl plotutils png pop posix postgres ppds pppd print profile python qt3 qt3support qt4 quicktime rar readline real realmedia recode reflection rhythmbox rpm rtsp sdl sdl-sound session sharedmem shorten simplexml slp smime sndfile sockets socks5 source sox speex spell spl sqlite sqlite3 sse ssl startup-notification svg svga svgz symlink sysfs sysvipc szip tagwriting tcl tcltk tcpd tetex tga tgif theora threads thunderbird tidy tiff tk truetype truetype-fonts type1-fonts unicode unzip usb v4l v4l2 vcd vidix vim-syntax vim-with-x vorbis wavpack wddx win32codecs wma wmf wmp wxwindows x86 xanim xcomposite xface xine xml xmlrpc xorg xosd xpm xprint xscreensaver xv xvid xvmc yahoo zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en-US en_GB fr_FR fr" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

----------------------------

# cat /etc/inittab
# Default runlevel.
id:4:initdefault:

# System initialization, mount local filesystems, etc.
si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.
rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown 
l1:S1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc ethernet
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
#z6:6:respawn:/sbin/sulogin
[...]

----------------------------

# diff /etc/runlevels/default/ /etc/runlevels/ethernet/
Only in /etc/runlevels/ethernet/: net.eth0

----------------------------

# cat /boot/grub/grub.conf

# Boot automatically after 30 secs.
timeout 7

# By default, boot the first entry.
default saved

# Fallback to the second entry.
fallback 1

# For booting GNU/Linux
title=Gentoo Linux (2.6.19-gentoo-r5) StandAlone
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=default
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5

# For booting GNU/Linux
title=Gentoo Linux (2.6.19-gentoo-r5) LAN
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll softlevel=ethernet
initrd /initramfs-genkernel-x86-2.6.19-gentoo-r5

----------------------------

Here are more kernel line parameters I've tried:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init 3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init 4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init=3
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll init=4


Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 3 root=/dev/hda5 vga=791 splash=verbose irqpoll
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 4 root=/dev/hda5 vga=791 splash=verbose irqpoll 

Code:

kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 'init=/sbin/init 3'
kernel /kernel-genkernel-x86-2.6.19-gentoo-r5 root=/dev/hda5 vga=791 splash=verbose irqpoll 'init=/sbin/init 4'
Comment 1 Nicolas Sebrecht 2007-07-09 21:28:23 UTC
Portage 2.1.2.7 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.5-r0,
2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 mobile AMD Athlon (tm) 1400+
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 22 Jun 2007 21:00:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -s"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf
/etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon-xp -pipe -s"
DISTDIR="/mnt/lacie/gnu-linux/distributions/gentoo/distfiles"
FEATURES="candy cvs distlocks metadata-transfer sandbox sfperms strict
userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.modulix.net/gentoo/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gentoo.tiscali.nl/
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/
http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_FR.utf8"
LC_ALL="fr_FR.utf8"
LINGUAS="en-US en_GB fr_FR fr"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages
--filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac aalib ace acpi adns aim alsa amarok amuled
ao arj asf audiofile bash-completion berkdb bidi bindist binfilter bitmap-fonts
bl bonjour bonobo branding bzip2 caps cdparanoia cdr cjk clamav cli colordiff
console cracklib crypt css cups cvs cvsgraph dbus devhelp dga dio divx djvu dmi
dri dts dv dvb dvd dvdread emacs emacs-w3 emerald enca encode enscript epson
escreen esd exif fam fame fat fbcon ffmpeg filepro firefox flac font-server
foomaticdb fortran fpx ftp gaim gb gcj gdb gdbm ggi gif gimp gimpprint glib
glut gmail gmedia gmp gnome gnome-print gnomedb gnutella gphoto2 gpm graphlcd
gs gstreamer gtk gtk2 gtkhtml guionly hal hardened hardenedphp hpn html iconv
icq id3 idn image imagemagick imap imlib isdnlog jabber jad java javascript
jbig jpeg jpeg2k lame lcms leim libcaca libg++ libgda libnotify libwww
lm_sensors lzo lzw mad magica maildir math matroska mbox mcal mcve md5sum mdb
midi mikmod milter mime mjpeg mmap mmx mmxext mng mod modplug motif mozilla mp3
mpeg mpi mplayer msn mudflap mysql mysqli nas ncurses network nfs nls nntp
no-seamonkey nodrm nptl nptlonly nsplugin odbc ofx ogg openal opengl openmp osc
oscar pam pch pcre pdf perl plotutils png pop posix postgres ppds pppd print
profile python qt3 qt3support qt4 quicktime rar readline real realmedia recode
reflection rhythmbox rpm rtsp sdl sdl-sound session sharedmem shorten simplexml
slp smime sndfile sockets socks5 source sox speex spell spl sqlite sqlite3 sse
ssl startup-notification svg svga svgz symlink sysfs sysvipc szip tagwriting
tcl tcltk tcpd tetex tga tgif theora threads thunderbird tidy tiff tk truetype
truetype-fonts type1-fonts unicode unzip usb v4l v4l2 vcd vidix vim-syntax
vim-with-x vorbis wavpack wddx win32codecs wma wmf wmp wxwindows x86 xanim
xcomposite xface xine xml xmlrpc xorg xosd xpm xprint xscreensaver xv xvid xvmc
yahoo zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106
cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0
intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file
hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route
share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses
text" LINGUAS="en-US en_GB fr_FR fr" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, MAKEOPTS,
PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS,
PORTDIR_OVERLAY
Comment 2 SpanKY gentoo-dev 2007-07-09 22:45:11 UTC
the softlevel is unrelated to the init runlevel
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-07-09 22:53:27 UTC
(In reply to comment #2)
> the softlevel is unrelated to the init runlevel

That is true, but rc should cater for this. We could re-open this bug and try and fix 1.12, but I know for sure it works as the reporter wants in baselayout-2.0.0_alpha3.
Comment 4 SpanKY gentoo-dev 2007-07-09 23:35:09 UTC
cater how exactly ?  softlevel does not imply a runlevel
Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-07-09 23:42:39 UTC
(In reply to comment #4)
> cater how exactly ?  softlevel does not imply a runlevel

softlevel on the kernel commandline does not change the numeric runlevel that sysvinit uses. Instead it changes the runlevel actually used by rc.
Comment 6 SpanKY gentoo-dev 2007-07-10 00:51:14 UTC
so what's the question ?  regardless of the numeric runlevel set as default by sysvinit, when `rc` is invoked by init to do the default runlevel, rc will actually do the specified softlevel
Comment 7 Roy Marples (RETIRED) gentoo-dev 2007-07-10 06:55:38 UTC
That the point. softlevel=foo will (or should) override the default in the inittab.
Comment 8 SpanKY gentoo-dev 2007-07-10 07:13:17 UTC
so we have some twisted logic in our rc that only respects softlevel when the sysvinit runlevel is 3 ?

the default inittab runs `rc default` for sysvinit runlevels 3/4/5 ... i'd expect all three to behave the same by default
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-07-10 07:24:41 UTC
Actually it's overridden regardless of numerical level. It's just a way of choosing to boot runlevel home or work via kernel command line.

This behaviour has been documented for ages.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap5
It's right at the bottom of the page.
Comment 10 SpanKY gentoo-dev 2007-07-10 09:00:30 UTC
so to get back to the original report ...

this line:
l4:4:wait:/sbin/rc ethernet
should read:
l4:4:wait:/sbin/rc default

we'll change the behavior so that baselayout-2 ignores the argument regardless when softlevel is used

the sysv runlevel is irrelevant
Comment 11 Roy Marples (RETIRED) gentoo-dev 2007-07-10 11:49:21 UTC
I've committed a patch to the svn repo which now ignores numerical runlevels
So to summarize

2
Will instruct sysvinit to enter runlevel 2

softlevel=foo
Will enter the default inittab level unless as above, but really do `rc foo`
Comment 12 Nicolas Sebrecht 2007-07-10 17:14:31 UTC
(In reply to comment #10)

> this line:
> l4:4:wait:/sbin/rc ethernet
> should read:
> l4:4:wait:/sbin/rc default

Works fine like this (tested).
 
> we'll change the behavior so that baselayout-2 ignores the argument regardless
> when softlevel is used
> 
> the sysv runlevel is irrelevant

Ok. Thank you both.