In the Linux / Unix administration handbook it mentions that you can edit the /etc/inittab
file to change the run level. I don't have that file on 10.04. I Googled this and found a tip saying that file had been replaced with /etc/event.d/rc-default
- however I don't have that file on my system either.
Have these been deleted or does 10.04 deal with run levels differently?
Yes, it deals with them differently.
To see the current (and previous) runlevel:
To switch runlevels:
For example, to reboot:
The init you are reading about was replaced by upstart starting with Edgy Eft 6.10; and, one of the programs provided by upstart is its own implementation of init. Here are the docs for 10.04.
To change the default runlevel, use your favorite text editor on /etc/init/rc-sysinit.conf...
Change this line to whichever runlevel you want...
Then, at each boot, upstart will use that runlevel.
To See the Current Run Level Command:
$ who -r or $ runlevel
If you want chance the runlevel Command
$ sudo init 1
( it will take to u single user mode)This are differnt runlevel you can perform :
0 - System halt; no activity, the system can be safely powered down.
1 - Single user; rarely used.
2 - Multiple users, no NFS (network filesystem); also used rarely.
3 - Multiple users, command line (i.e., all-text mode) interface; the standard runlevel for most Linux-based server hardware.
4 - User-definable
5 - Multiple users, GUI (graphical user interface); the standard runlevel for most Linux-based desktop systems.
6 - Reboot; used when restarting the system.
Normally this is done by explicitly adding a number to the kernel options in the GRUB entry.
Let's say, you want to change default grub entry from default run level (5) to 3:
Find a place of default boot entry, and have a look at
linux
line. Might look something like this:Add
3
at the end of that line:Try it out:
You could also make use of the corresponding target of your desired runlevel. You can check which of the available target your system is running as default using:
Supposing the graphical.target is the default, you can further check its definition and detailed information using:
systemctl cat graphical.target
. There are some target units tailored after the corresponding runlevels. You can find which of them are available on your system by listing them:systemctl list-unit-files -t target
Suppose you want to set runlevel 2 as default, you can do this by running:You should use this with caution and make sure you are not causing any issues running on the inappropriate target.