Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-09-2005, 02:26 PM   #1
LQ Newbie
Registered: Mar 2004
Location: da Big Apple
Distribution: FC3
Posts: 20

Rep: Reputation: 0
changing runlevels stops X?

I've been toying with the idea of using runlevel 4 as a "battery" runlevel, basically stopping every service I can possibly stop and doing every extreme measure possible to extend my laptop's battery life to more than an hour (seeing as I get 4 hours in Windoze).

With that in mind, I copied all of my runlevel 5 scripts into runlevel 4, then tried (in a su -) to do an:

init 4

Unfortunately, this ended X. I could do a CTRL-ALT-F1 and login again, startx, and be on my way in runlevel 4, but that seems to be a lot overkill for just ending a few services and starting a few more. Am I doing something wrong? (I must be!) Thanks much!

Here's the /etc/inittab

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)

# System initialization.

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"

# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
#x:5:respawn:/etc/X11/prefdm -nodaemon
Old 05-09-2005, 03:19 PM   #2
Senior Member
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,241

Rep: Reputation: 77
You can save yourself a whole lot of trouble by just installing laptop-mode-tools. It is available as a package by the same name in Debian. In RedHat, you can search for an rpm of the same name.

See this for more information:
Old 05-15-2005, 10:45 AM   #3
LQ Newbie
Registered: Mar 2004
Location: da Big Apple
Distribution: FC3
Posts: 20

Original Poster
Rep: Reputation: 0
yeah, I've done that. Starting laptop_mode would have been one of the things happening in the switch to "battery run level" I have ACPI scripts set up to do it as well (from laptop_mode_tools) but still wasn't impressed with my battery life.

Basically I wanted to turn off things like cron and anacron- no need to run background jobs and eat up my battery power.

It turns out my battery is rather dead anyway, and the gain from turning off other services would be useless, so this project got put on a back-burner until I get a new battery.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RunLevels bcom Mandriva 3 05-31-2004 07:07 PM
VNC Works then stops! Reboot fixes but then it stops again! Leethal Linux - Software 1 02-26-2004 07:57 AM
runlevels? Computergirl24 Linux - Software 4 12-26-2003 04:45 PM
Prevent services from restarting when changing runlevels fearofcarpet Red Hat 1 11-13-2003 02:22 PM
changing runlevels at boot time on GRUB denominator Linux - Newbie 3 11-04-2003 11:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration