Saturday, August 23, 2008

Optimizing the Ubuntu Boot Process

The /sbin/init process uses an entry in /etc/inittab for your system’s default run level to run scripts that start various services at boot time. You can manually customize the run levels at which various services start, but this is tedious at best. As you might expect, the Ubuntu repositories provide a number of applications that simplify editing the startup and shutdown scripts associated with different run levels. Ubuntu comes with an application
(System -> Administration -> Services) that promises to provide coarse control over which services are started at boot time, but does not provide granular control over the run levels with which these services are associated or the sequence in which they are started. (This is odd because it used to do this. I guess that progress is not always forward.)

My two favorite tools for modifying the scripts started at various Ubuntu run levels are the following:

• sysv-rc-conf: An application that runs in any Ubuntu terminal application, such as an xterm or the GNOME Terminal. The SysV Runlevel Config application provides a simple interface for enabling or disabling services at various run levels, and includes onscreen help for its user interface.

• Boot-Up Manager: A graphical application that provides an excellent user interface for enabling and disabling startup/shutdown scripts at various run levels.

Neither the syv-rc-conf or Boot-Up Manager applications are installed automatically as part of a default Ubuntu installation, but can easily be installed using the Synaptic Package Manager or the command-line apt-get application.

The Boot-Up Manager is by far the more interesting of these two applications (as long as you’re running an X Window system desktop or window manager). Installing this application adds the System -> Administration -> Boot-Up Manager menu item, which you can use to start the application. Like most administrative applications, you’ll need to supply your password to run this application. The Boot-Up manager requires a fair amount of time to start, as it must read and process every startup script in the /etc/init.d directory and must read every symbolic link in any of your /etc/rc directories. This additional startup time is worth it in terms of usability.

Once the Boot-Up Manager is running, it provides some basic information about each of the startup scripts that your system is running, which helps you make intelligent decisions about the services that you want to enable or disable. However, clicking the Advanced checkbox on its main dialog displays two additional tabs that provide access to the real power of the Boot-Up Manager. You can click either of these tabs to display more detailed information about the topic with which it is associated, or click the Summary tab to display the standard Boot-Up Manager. Boot-Up Manager’s Services tab, provides a detailed description of the services that are stopped and started by available run level scripts, and the different run levels with which each is associated.

You can start or stop any existing service, remove it from the startup and shutdown sequence, or modify the sequence in which that script is executed during the startup or shutdown processes by right-clicking any entry in the Services tab to display the pop-up menu. To change the sequence in which a script is executed during the startup and shutdown processes, select Change start/stop priority from the pop-up menu. (Identifying a script’s sequence number as its priority is somewhat misleading, but c’est le vie.) A dialog shown, you can enter the new numeric identifier for the sequence in which you want this script to run during the startup or shutdown process.

After modifying these values, click OK to save your changes and return to the Services tab or click Cancel to return to the Services tab without making any changes. Any changes that you specify are made to your system immediately. (The current Boot-Up manager doesn’t update its internal display to use the new sequence number until the next time that you start the Boot-Up Manager, which is certainly a bug.) In addition to enabling you to modify the startup and shutdown scripts associated with various system services, clicking the Boot-Up Manager’s Advanced checkbox also displays a tab on which you can examine the startup and shutdown scripts that are run during the boot process through the system initialization script identified by the sysinit entry in your /etc/inittab file. Click the Startup and shutdown scripts tab to see a list of these other scripts and the part of the system startup or shutdown sequence that they are associated with.

The SysVInit process is well-known and well-established, but has been used for years without any substantial modifications. Its biggest problem is that all of the scripts that it executes are executed sequentially, which means that your system’s startup process can take much longer than it needs to, assuming that there are no major dependencies between startup scripts. Jimmy Wennlund’s initng (Init, Next generation) replacement for the standard /sbin/init process is a great step in the right direction, supporting parallel execution of startup scripts whenever possible. The InitNG program also enables you to collect additional statistics that may be useful to you when analyzing your system’s startup performance. See the InitNG home page, http://initng.thinktux.net, for more information about this project (and the source code). InitNG is actively under development and is still maturing, but you can experiment with it by building and installing it on your system, and then modify your GRUB kernel command line to include the statement init=/sbin/initng. This enables you to experiment with InitNG without risking any problems with your current, traditional initialization sequence.

>>> Read more about Examining Ubuntu Boot Process with Boot Chart <<<

Source of Information : Ubuntu Linux - Bible

No comments: