[NTLUG:Discuss] Change run level at boot time
terry
trryhend at gmail.com
Sat Aug 20 08:38:27 CDT 2011
On Fri, Aug 19, 2011 at 12:19 AM, Leroy Tennison
<leroy_tennison at prodigy.net> wrote:
> The web isn't helping (or I don't know what to query for). Assume booting
> with grub. I want to be able to press 'e' to edit the command prompt and
> change the runlevel. I can't seem to find a clear example of a command line
> parameter to do this, can anyone provide one? I've looked at the kernel
> command line parameters and didn't see anything (or missed it). I haven't
> found anything about init command line parameters which would do this. I
> don't want to change inittab because I'd have to specify runlevel on each
> boot. Anyone know of a way?
>
Not knowing exactly what you really want to do, it's hard to advise
you, but we can assume you want some or all of the services disabled
when you boot. There is "linux single" which would be runlevel 1,
single user mode, no network. So if you put "linux single" at the
end of the kernel line, that should do the trick. On Ubuntu and some
of the others, you should find an option in the grub menu for failsafe
or something to that effect which is pretty much the same thing as
"linux single".
If you are running Debian or Ubuntu or Fedora, they all use upstart
now days. Upstart is an event-based replacement for the /sbin/init
daemon which handles starting of tasks and services during boot,
stopping them during shutdown and supervising them while the system is
running. See: http://upstart.ubuntu.com/
On a system that uses upstart, you can change the runlevel but it
won't make any difference. To change runlevel after the system is up
and running do:
telinit 3
or
telinit 1
etc.
On systems that run upstart you'll find that you can start, stop and
restart services with the "service" command.
i.e.
service cups stop
You can see a list of all services with command:
service --status-all
For more info see
man service
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
--
In God we trust.
<><
More information about the Discuss
mailing list