Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196338 - sys-apps/baselayout-2 gets hung up by recursively changing runlevels
Summary: sys-apps/baselayout-2 gets hung up by recursively changing runlevels
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-18 22:58 UTC by Ira Snyder
Modified: 2007-10-29 16:03 UTC (History)
0 users

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 Ira Snyder 2007-10-18 22:58:33 UTC
I've been using sys-apps/baselayout-2.* on my laptop since it came out. I have followed the Gentoo Power Management Guide (http://www.gentoo.org/doc/en/power-management-guide.xml), which includes a pmg_switch_runlevel.sh script to switch the system to the battery profile when acpid detects the removal of the AC adapter. I have modified the script to use /lib/rcscripts/init.d/softlevel instead of /var/lib/init.d/softlevel, due to baselayout-2 changing the location.

The guide mentions putting a call to the script into /etc/conf.d/local.start so that if the system boots on battery, the runlevel is still changed. Upon doing this, it boots normally on AC power, but hangs at that line for about 2 minutes when booting on battery. Note that the boot process does eventually complete correctly, it just takes a long time. Removing that line from my local.start makes the system boot in the same amount of time as it does on AC power.

If I am doing something wrong, it is unclear to me what it is, and any insight would be greatly appreciated.

Reproducible: Always

Steps to Reproduce:
1. emerge baselayout-2.*
2. Follow the Gentoo Power Management Guide, modifying the pmg_switch_runlevel.sh script as necessary for baselayout-2
3. Add the line from the PM Guide to your /etc/conf.d/local.start
4. Boot on AC power, note the approximate time taken
5. Boot on Battery power, note that it hangs at "starting local" for a very long time

Actual Results:  
The system takes a very long time to boot up on battery, but not on ac power.

Expected Results:  
The system should start up at approximately the same speed on battery and on ac power.

irasnyd@kimiko ~ $ emerge --info
Portage 2.1.3.14 (default-linux/x86/2007.0/desktop, gcc-4.2.2, glibc-2.6.1-r0, 2.6.23-kamikaze3 i686)
=================================================================
System uname: 2.6.23-kamikaze3 i686 Genuine Intel(R) CPU T2400 @ 1.83GHz
Timestamp of tree: Tue, 16 Oct 2007 06:50:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0_rc5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
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/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
LINGUAS="en"
MAKEOPTS="-j3"
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"
PORTDIR_OVERLAY="/usr/portage/local/layman/gentopia /usr/portage/local/layman/xeffects /usr/portage/local/layman/nx /usr/local/portage"
SYNC="rsync://ping.local/gentoo-portage"
USE="X a52 aac acpi aiglx alsa aoss aotuv avahi bash-completion berkdb bitmap-fonts cairo cdr chardet cli cracklib crypt cscope cups dbus djvu dri dts dvd dvdr dvdread dvi emboss encode evo fam filter_default firefox flac fortran gdbm gif glitz gnome gpm gsl gstreamer gtk hal iconv ipv6 isdnlog jpeg libnotify mad matroska mikmod mmap mmkeys mmx mmxext mozbranding mp3 mpeg mudflap musepack nautilus ncurses newspr nonfsv4 nptl nptlonly offensive ogg opengl openmp oss pam pcre pdf perl pertty png pppd pulseaudio python qt3 qt3support quicktime readline real reflection rtc rtsp samba sdl session skins smp spell spl sqlite sse sse2 ssl startup-notification subtitles svg tcpd theora threads truetype truetype-fonts type1-fonts unicode userlocales vorbis win32codecs wxwindows x86 xcb xcomposite xforms xml xorg xosd xv xvid zlib" ALSA_CARDS="hda-intel" 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="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="vesa fbdev i810"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2007-10-19 07:06:34 UTC
i dont think allowing recursive changes of runlevels is OK
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-10-19 07:39:08 UTC
And will cause issues.

Currently this is possible by having a script in the boot runlevel that writes the runlevel to load next to "${RC_SVCDIR}"/ksoftlevel.

if on_battery; then
   echo "battery" > "${RC_SVCDIR}"/ksoftlevel
fi

Although we should probably have a function to do that. set_next_runlevel maybe?
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-10-29 16:03:51 UTC
I patched our svn repo for to accept rc --override battery

Will instruct rc to change into the battery runlevel next, when leaving single user or boot runlevels.

Will be in rc6.