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?
14 Answers
Yes, it deals with them differently.
To see the current (and previous) runlevel:
runlevelTo switch runlevels:
sudo init $runlevelFor example, to reboot:
sudo init 6The 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...
sudo vim /etc/init/rc-sysinit.confChange this line to whichever runlevel you want...
env DEFAULT_RUNLEVEL=2Then, 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.
1Normally 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:
sudo vim /boot/grub/grub.cfgFind a place of default boot entry, and have a look at linux line. Might look something like this:
linux /boot/vmlinuz-3.0.0-13-generic root=UUID=d07e0c99-65ba-4eda-98d8-79693dc79554 ro quiet splash vt.handoff=7Add 3 at the end of that line:
linux /boot/vmlinuz-3.0.0-13-generic root=UUID=d07e0c99-65ba-4eda-98d8-79693dc79554 ro quiet splash vt.handoff=7 3Try it out:
sudo reboot 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:
systemctl get-default 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:
sudo systemctl set-default runlevel2.targetYou should use this with caution and make sure you are not causing any issues running on the inappropriate target.