[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: runlevels question



"Provost, Stephane" <sprovost@nuera.com> writes:

> I have a question. How do you set up multiple runlevels, such as one if the
> laptop is plugged into AC, one if it is on battery, one if connected to the
> LAN, one if it's a leap year, etc... I didn't know that was possible, and
> I'd be interested to know how to do it.

Edit the symlinks in /etc/rc[2345].d.  Everything in that directory
should be named S##program or K##program, and be a symlink to
../init.d/program.  When you change runlevels, all of the K links,
then all of the S links, in the new runlevel are run, in order by
number.  The default configuration is that runlevels 2, 3, 4, and 5
are all the same, and start everything that's installed.  You might
read /usr/share/doc/sysvinit/README.runlevels.gz for some more
information.

To change runlevels, you can either use the bootloader (something like
'linux 3' from the LILO prompt, or press 'e' to edit the kernel
command line from GRUB) or run 'telinit 3'.  Runlevels 0, 1, and 6 are
reserved.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: