Controlling Services at Boot with Administrative Tools

As the master control file for system startup, /etc/inittab and its corresponding system of symbolic links control system services. You can manage /etc/inittab and its symbolic links using the Services administrative tool located under the System > Administration menu:

In the Services dialog (shown in Figure 15.1) Ubuntu lists all the services that you can have automatically start at boot time. They are usually all enabled by default, but you can simply uncheck the ones you don't want and click OK.

Figure 15.1. You can enable and disable Ubuntu's boot-up services by toggling the checkboxes in the Services dialog.

Figure 15.1. You can enable and disable Ubuntu's boot-up services by toggling the checkboxes in the Services dialog.

Changing Runlevels

After making changes to system services and runlevels, you can use the telinit command to change runlevels on-the-fly on a running Ubuntu system. Changing runlevels this way allows system administrators to alter selected parts of a running system in order to make changes to the services or to put changes into effect that have already been made (such as reassignment of network addresses for a networking interface).

For example, a system administrator can quickly change the system to maintenance or single-user mode by using the telinit command with its s option like this:

# telinit S

The telinit command uses the init command to change runlevels and shut down currently running services. The command then starts services for the specified runlevel, where in this example, the single-user runlevel is the same as runlevel 2. The init command can only be run from a console, not from an xterm running in an X session.

After booting to single-user mode, you can then return to multi-user mode without X, like this:

# telinit 3

If you have made changes to the system initialization table itself, /etc/inittab, use the telinit command's q command-line option to force init to re-examine the table.

Linux is full of shortcuts: If you exit the single-user shell by typing exit at the prompt, you will go back to the default runlevel without worrying about using telinit.

0 0

Post a comment