Services on a Linux system are daemon processes; that is, they are alive throughout the time that the system is up and running. Typically, services are configured to start at boot time. Super users may disable a service or start one. Examples of services are telnet, ftp, rlogin, and so on. Services may be managed from the Start menu System Settings>Server Settings>Services (see Figure 2-49).
Services can be picked from the left panel, and you choose operations to perform on them, such as starting or stopping them, from the buttons on the top panel.
When the computer starts up, the operating system loads and starts off the first process ”the init process. The init process then starts off any required subprocesses before the computer is ready to be used by the user . The processes that the operating system needs to start off after the booting process are specified using run levels . A run level is a state of the machine that determines the processes to be run.
The following describes the seven run levels, numbered from 0 to 6:
Run level 0 signifies the halted state of a machine. While changing run levels, if you set the new run level to be 0, it effectively halts the machine.
Run level 1 stands for the single user mode . This brings the machine to a super user mode and disallows external users from using the machine. All networking functions are disabled at this level. This level is also called the system maintenance mode because it is generally used to recover from serious system problems. At this level, the root prompt is displayed without any attempt to check the corresponding password. This is necessary to allow for the various maintenance functions that need to be done without the hindrance of an authentication system; however, it also leaves the system open to any malicious users physically present at the computer. Therefore, this run level should be used only when absolutely necessary.
Run level 2 allows multiple users to log in to the machine through virtual terminals and other login devices, but still doesn t activate any networking functions.
Run level 3 finally allows networking processes to be started, and allows the complete resources of the system to be used effectively. However, until this level the interface to the desktop is through a CLI interface. Because the GUI interface uses the computer resources (such as CPU, memory, and hard disk) intensively, this run level is mainly used by server class workstations where precious computer resources are used to deliver networking and other application services more effectively.
Run level 4 is unused. You can use it to define your own custom run level.
Run level 5 finally allows the X-server process to be started and the accompanying desktop to be loaded to allow users to use the system with a GUI. The desktop that you have been using until now has been working at run level 5.
Run level 6 signifies the rebooting state of a machine and is used to restart the machine.
When a machine boots, the init program examines the contents of the configuration file /etc/inittab to determine the run level to boot the computer to and executes all the processes for that run level. The processes to execute for a particular run level are specified as special program scripts in the directory /etc/rcx.d/ , where x is the run level to boot to.
You can find the computer s present run level by using the program runlevel . This outputs two numbers , which represent the previous and current run levels.
You can change the current run level using the telinit program. This program needs to be executed as root, and takes a single argument ”the run level to boot to. For example, to reboot the system you can execute the command telinit 6 .
Additionally, run levels and the processes that are part of a run level can be managed from the Services menu discussed previously in this chapter.