Archive for March, 2008

450 CHAPTER 31 OPTIMIZING YOUR SYSTEM Table

Friday, March 28th, 2008

450 CHAPTER 31 OPTIMIZING YOUR SYSTEM Table 31-1. Ubuntu Run Level Services (Continued) Service Description hotplug-n[et] hplip ifrename ifupdown ifupdown-[clean] klogd linux-res[trictedmodules-common] lvm makedev mdadm mdadm-raid module-in[it-tools] mountvirt[fs] networking ntpdate pcmcia powernowd ppp pppd-dns readahead Works like hotplug. Don t disable it. Subsystem for Hewlett Packard (HP) scanners and/or printers. If you don t use an HP scanner or printer, you can disable this. Part of the networking subsystem that allows the renaming of network devices. Unless you re running a complicated server system, this can be safely disabled. If you find your network connection doesn t work afterwards, enable it. Part of the network subsystem. Don t disable it. Part of the network subsystem. Don t disable it. Logs kernel messages. This is handy for problem solving, but this service can be disabled if you re absolutely sure you ll never need it. Handles the loading of closed-source kernel modules, such as some wireless card and graphics card drivers. Unless you re sure you don t use such drivers, don t disable this service. Controls the Logical Volume Management (LVM) subsystem. If your system doesn t use RAID or any other kind of LVM system, this service can be disabled. Controls the /dev hardware subsystem. Don t disable it. Controls the software RAID setup. Disable it if you don t use software RAID. Controls the software RAID setup. Disable it if you don t use software RAID. Loads additional kernel module(s). Don t disable it. Mounts virtual file systems that are essential to Ubuntu. Don t disable it. Manages network interfaces. Don t disable it. Synchronizes time with the Ubuntu time servers. You can disable this, unless your PC s system clock is faulty and loses/gains time. Starts PCMCIA devices on notebooks. You can disable this if you use a desktop computer, unless you have a PCI-based wireless card (or similar) that uses a PCMCIA card. Controls the CPU frequency scaling service that s common on many notebook and desktop computers. This can be disabled if absolutely necessary, but it s a good thing to have around. Controls PPP connections, such as those established by modems (both dial-up and DSL/cable). If you don t use a modem, you can disable this. Controls PPP connections. You can disable it if you don t use a modem. Optimization software designed to store commonly used libraries in memory. It s designed to speed up your system, but many people report it makes little difference, so it can be disabled.

Disney web site - CHAPTER 31 OPTIMIZING YOUR SYSTEM 449 Table

Thursday, March 27th, 2008

CHAPTER 31 OPTIMIZING YOUR SYSTEM 449 Table 31-1. Ubuntu Run Level Services (Continued) Service Description anacron Runs scheduled tasks, as described in Chapter 33. It allows the running of housekeeping tasks, so you shouldn t disable it (although it s not essential to the running of Ubuntu). apmd Activates the Advanced Power Management (APM) function. Nowadays, APM has been superseded by ACPI, so if you re sure your computer uses ACPI, you can disable this service. atd Scheduling service, as discussed in Chapter 33. If you don t use the at command, you can disable this. bluez-uti[ls] Required for the correct functioning of Bluetooth hardware (mobile phones, wireless headphones, and so on). If you don t use Bluetooth, you can disable this. bootlogd Logs boot messages. If you re sure you ll never, ever examine the boot log, as is sometimes necessary when problem solving, you can disable this service. cron Another scheduling service, as discussed in Chapter 33. Many housekeeping tasks are run via cron, so this should not be disabled (although it s not essential to the running of Ubuntu). cupsys Part of the printing subsystem. If you don t use a printer, either attached directly or across a network, this can be disabled. dbus Allows software to communicate with other software. It s vital, so don t disable it. dns-clean Part of the ppp subsystem that s designed to facilitate modem network connections. If you use a modem of any type, don t disable this. If you use an Ethernet or wireless connection, it can be disabled. evms Controls the Enterprise Volume Management Subsystem, which is used to manage multiple disk setups. If your computer doesn t use RAID or any other kind of logical partitioning scheme, you can disable this. If your computer has only one hard disk, you can definitely disable this service. fetchmail System service that can collect mail from remote mail servers for local delivery. It can be disabled on most systems, unless your mail client specifically uses it. The default e-mail client under Ubuntu, Evolution, doesn t use fetchmail. gdm Starts the GNOME desktop subsystem and therefore the X server. Don t disable this, unless you want a command-prompt-only run level. halt Used to shut down the system. Don t disable this service. hdparm Runs the hdparm.conf script, which allows you to optimize your hard disk settings. Don t disable this. hotkey-se[tup] Configures various additional keys on some notebook computers, such as those that allow the dimming of the screen. You can disable this, unless you re using a notebook computer. hotplug Controls systems such as USB and PCMCIA that allow hardware to be inserted when the computer is switched on. Also controls some sound devices. Don t disable this.

448 CHAPTER 31 (Web hosting provider) OPTIMIZING YOUR SYSTEM Figure

Wednesday, March 26th, 2008

448 CHAPTER 31 OPTIMIZING YOUR SYSTEM Figure 31-3. Remove the X from the check box alongside any service you would like to disable. Table 31-1 lists the various run-level services, along with a short description of what they do and whether it s safe for you to disable them. Only remove the check from the boxes of services you wish to deactivate! Don t disable any services that you think should be running or otherwise interfere with the run-level settings. There s a very real risk you will damage your setup by doing so. Limit your changes to the services you specifically want to remove. Note SysV Runlevel Config truncates the names of some services in the left hand column. In Table 31-1, I ve listed the services as stated by the program, and then continued the full name within square brackets for clarity. Table 31-1. Ubuntu Run Level Services Service Description acpi-supp[ort] Required for proper running of the Advanced Configuration and Power Interface (ACPI). It s vital to the correction functioning of Ubuntu, so don t disable it unless your computer uses the alternative Advanced Power Management (APM) system (see the apmd service). All modern computers use ACPI. acpid Also required for ACPI. Don t disable it. alsa At one time, this started the sound hardware, but it is no longer used. It s disabled by default in all run levels. alsa-utils Controls the volume of the system on startup. Don t disable it.

CHAPTER 31 OPTIMIZING YOUR SYSTEM The one-size-fits-all (Web design)

Wednesday, March 26th, 2008

CHAPTER 31 OPTIMIZING YOUR SYSTEM The one-size-fits-all approach of Ubuntu means that some services that are started up aren t always necessary. A good example is the Bluetooth service. This is started up on every single Ubuntu system, yet only a fraction of users will ever use it. Therefore, if you don t use Bluetooth hardware (and are certain you never will), you can safely disable it and retrieve the chunk of memory it uses, as well as the amount of time it takes to start during bootup. Approximately 60 run-level scripts start on a typical boot. By selective pruning, you can easily remove around a quarter or even a third of these, but caution is advised. You re altering a fundamental aspect of your system configuration, and one simple mistake can make the difference between a system that works and one that is no longer able to boot. Disabling Run-Level Scripts You can use the Services Settings program (System . Administration . Services) to control which run-level scripts start at bootup, but, sadly, it doesn t allow the enabling/disabling of initialization (run level S) scripts. It allows you to edit only certain numbered run-level scripts. Therefore, you need to download a command-line program called SysV Runlevel Config that can do the job. It offers a pseudo-graphical interface by which services can be activated and deactivated on all run levels, including S. To obtain the SysV Runlevel Config program, use the Synaptic Package Manager. (If you haven t already set up the Synaptic Package Manager to use online repositories, see Chapter 8.) Select System . Administration . Synaptic Package Manager, click Search, and search for sysv-rc-conf. Mark it for installation, and then click Apply. Open a GNOME Terminal window (Applications . Accessories . Terminal), and then maximize it to the full size of the screen. Then type the following to start the SysV Runlevel Config program: sudo sysv-rc-conf s 2S This command runs SysV Runlevel Config showing only run levels 2 and S, to remove potential confusion between run levels. The program s interface, shown in Figure 31-3, is simple. On the left, you see a list of the various scripts that are contained in the /etc/init.d directory and are therefore available for use during bootup (both initialization scripts and numbered run-level scripts). Not all of them are used. Those that aren t used are there in case they will be needed in future, or are provided for legacy reasons so that some software will work correctly. Along the top of the program window are the run levels you re going to edit: 2 and S. If the check box next to a service has an X in it, that script is run on that particular run level. You can change this by navigating to the check box with the cursor keys and pressing the spacebar. You can scroll through the list of services by moving the cursor down to the bottom of the screen, or by pressing Ctrl+N to scroll down a page. Ctrl+P will move you up a page.

446 CHAPTER 31 OPTIMIZING YOUR SYSTEM Figure

Tuesday, March 25th, 2008

446 CHAPTER 31 OPTIMIZING YOUR SYSTEM Figure 31-2. You can stop the GRUB menu hanging around for so long by changing the timeout value in its configuration file. Optimizing Initialization and Run-Level Services Perhaps it goes without saying that the majority of bootup time is spent starting the run-level scripts. This is when the entire system comes to life hardware and essential software services are activated. But this isn t to say that all run-level scripts are essential. Note A service is a piece of background software that provides something that you, the user, need on a day-to-day basis. Some services manage hardware, such as the graphical interface, printing services, and networking. Some services provide software services, such as logging files or checking the system clock against a time server.

CHAPTER 31 OPTIMIZING YOUR SYSTEM Figure 31-1.

Monday, March 24th, 2008

CHAPTER 31 OPTIMIZING YOUR SYSTEM Figure 31-1. The scripts for each run level are contained in the /etc/rcX.d directories, where X is the run-level number. Once all that has finished, you can use the computer! Because so much must take place for your system to come to life, booting Ubuntu can take some time. On my test system, it averaged between one and two minutes. Certainly, you can shave some time from this. Reducing the Boot Menu Delay Getting rid of the GRUB boot menu delay can save some waiting around in the early stages of the boot process. The delay can be reduced to a second, or even eradicated completely. Of course, in such a case, you won t be able to choose which operating system you want to load if you re dual-booting with Windows. Even if Ubuntu is the only operating system on your computer, without the boot delay, you won t have the chance to boot into recovery mode, as offered on the GRUB menu. So you need to consider whether this is a worthwhile time-saving measure. The boot menu delay is stated in the /boot/grub/menu.lst file. You can load this into the Gedit text editor by typing the following: sudo gedit /boot/grub/menu.lst Look for the line that begins with timeout, as shown in Figure 31-2, and change the value to whatever you wish. The units are counted in seconds, so a value of 3equates to three seconds. A value of zero (0) will mean the boot menu won t appear at all. Generally speaking, a delay of a second (1) gives you just enough time to hit a key at the appropriate time, and this will then cancel the countdown, meaning the boot menu will stay on your screen until you select an option. When you ve finished, save the file and quit Gedit.

444 CHAPTER 31 (Web domain) OPTIMIZING YOUR SYSTEM Note

Monday, March 24th, 2008

444 CHAPTER 31 OPTIMIZING YOUR SYSTEM Note Actually, the /etc/rc directories don t contain the scripts. They merely contain symbolic links to scripts, which are contained in /etc/init.d. The initialization scripts take care of the basics of the system, ensuring that vital hardware and software services are started. Initialization scripts are considered critical in order for the system to run correctly. Numbered run-level scripts are more optional. They provide services the user may or may not need, depending on how the computer will be used. For example, a numbered run-level script might start the printing service. Another numbered run-level script might start the GUI components. Some users may not need either of these, so they could be removed. Ubuntu has seven groups of numbered run-level scripts, ranging from 0 through 6. Each defines the mode in which the computer is running. For example, run level 1 is single-user mode. This means that only one user can log in, and networking is disabled (usually, many other nonessential services are not activated either). Note Run level 6 is reboot mode and exists simply to reboot the system, while run level 0 is halt mode and will shut down the system. You ll probably never come into direct contact with these run levels. Instead the programs you use to shut down or restart the system, such as the System . Log Out option within GNOME, use these run levels. On Ubuntu, run levels 2 through 5 are defined as multiuser. Technically speaking, this means that they allow more than one user to log on, but actually, they re the day-to-day running modes of the computer. Run level 2 is the default run level under Ubuntu and, just as the system initialization scripts are contained in /etc/rcS.d, run level 2 scripts are contained in /etc/rc2.d, as shown in Figure 31-1. Note In fact, Ubuntu s run levels 2 through 5 are identical. Run levels 3 through 5 might be described as spares, existing merely for further expansion possibilities. For what it s worth, it s theoretically possible to utilize run levels 7, 8, and 9, but few people do so because 2 through 5 offer more than most users need. You might think that once the run-level scripts have completed, the system is ready to be used. But that s not the case. Although you ll be able to log on when the run-level scripts have finished, the GNOME desktop has yet to start, and this, too, has its own set of initialization processes. It needs to start its own set of programs, such as notification area applets, which provide handy functions like on-screen volume control.

CHAPTER 31 Optimizing Your System (Adelphia web hosting)

Sunday, March 23rd, 2008

CHAPTER 31 Optimizing Your System One slight problem with Ubuntu (and all Linux distributions) is that they take a one-sizefits- all approach the default installation attempts to provide services for the every kind of user. While this provides the widest range of compatibility, it doesn t always ensure an optimized system. You may never attach a printer to Ubuntu, for example, so what s the point of keeping the printing subsystem in memory? You can remove it from your Linux setup and not only free memory, but also speed up boot times, because you no longer need to wait for the printer service to start. While this might save only a couple seconds, or just a couple of hundred kilobytes of memory, repeating the process and paring Ubuntu down to the bone can produce an ultra-efficient system. In this chapter, you ll learn how to target the various subsystems of your Linux system in order to optimize and speed up your computer. We ll look at everything from bootup, to hard disks, to streamlining the kernel itself. Speeding Up Booting Let s take a look at what happens when a Ubuntu-equipped PC boots. Then we ll explore some ways to speed up the process. Understanding Bootup When you start your computer, initially, the computer s BIOS searches for a boot program on the hard disk. In the case of Ubuntu, the boot program runs the GRUB boot loader. If you ve installed Ubuntu alongside Windows (or any other operating system), the GRUB menu will appear at this stage, and you ll be able to choose which operating system to load. If only Ubuntu is on the hard disk, you ll see a brief prompt for three seconds telling you that the GRUB menu will appear if you press a key. However your system is set up, GRUB has the same fundamental function: it s designed to load the Linux kernel. The kernel then starts the very first program that s run on any Linux system: init. The principal job of init is to run a variety of run-level scripts, which load the hardware and software necessary for the full and correct functioning of the system. Two sets of run-level scripts run at this time: system initialization scripts, which are contained in /etc/rcS.d, and numbered run-level scripts, which are found in /etc/rcX.d (where X is the number of the current run level).

Web design careers - 442 CHAPTER 30 MANAGING USERS Alternatively, by

Saturday, March 22nd, 2008

442 CHAPTER 30 MANAGING USERS Alternatively, by adopting superuser powers, a user can change the password of another account: sudo passwd This is necessary just after you create a new user account because it isn t given a password automatically. For obvious security reasons Ubuntu won t allow blank passwords. You can enter just about anything as a password, but you should bear in mind some common-sense rules. Ideally, passwords should be at least eight characters long and contain letters, numbers, and even punctuation symbols. You might also want to include both uppercase and lowercase letters. A number of command options can be specified along with the passwd command when it used with superuser powers. For example, the -l option will lock the specified account so that it can t be accessed (the -u option will unlock it). Tip You can temporarily switch into any user account by typing su . When you ve finished, simply type exit to return to your own account. Summary In this chapter, we looked at the principles behind user and group accounts under Ubuntu. We ve examined how user and group accounts can be created, edited, and deleted using the GUI, as well as the command-line prompt. We also looked at how passwords can be manipulated by the individual users themselves and by a user with superuser powers. In the next chapter, we ll look at how the system can be optimized. You ll also learn about several interesting and important system tools.

Shared web hosting - CHAPTER 30 MANAGING USERS 441 Table 30-1.

Saturday, March 22nd, 2008

CHAPTER 30 MANAGING USERS 441 Table 30-1. System Groups Within Ubuntu Group Definition video Activates video acceleration for the user plugdev Allows user access to removable storage, such as card readers, digital cameras, and so on lpadmin Allows user to access the printer scanner Allows user to access the scanner tape Allows user to access tape storage devices (used for backup purposes) fax Allows user to access the fax facility admin Gives user system administration abilities (superuser powers) As you might have guessed, to manually add a user under Ubuntu, you must not only create a group and then add the user to it, but you must also add that user to the required selection of supplementary groups. Some are mandatory, such as audio, while others are optional, depending on how much freedom you want to afford the new user. You can add a user to supplementary groups by using the -G switch with adduser. Here s how to add a new user called raymond to the system so that he is able to make full use of the system (having first created a group called raymond): sudo useradd -m -g raymond -G adm,dialout,cdrom,floppy,audio,dip,video,plugdev, lpadmin,scanner,tape,fax,admin raymond Additionally, creating a new user using useradd won t automatically apply a password to the account. Ubuntu can t work with passwordless accounts, so until one is applied, the new account will be locked. You can add a password using the passwd command, as discussed in the next section. Deleting a user is mercifully simple compared to this! Use the userdel command, as follows: sudo userdel This won t remove raymond s /home/ directory, however. That must be done manually. Similarly, to delete a group, use the groupdel command: sudo groupdel Adding and Changing Passwords On a default Ubuntu installation, ordinary users are able to change their passwords at the shell. The command for any user to change his password is simple: passwd The user will be asked to confirm his current password, and then to enter the new password twice, to confirm that it has been typed correctly.