Monthly Archives: April 2007

Hacking Ubuntu to Improve Performance

from: http://www.extremetech.com/article2/0,1697,2114115,00.asp
This feature includes various hacks to s such as viewing running processes, identifying resources, finding process startups, tuning kernel parameters, and speeding up boot time. This is a complete chapter in the ExtremeTech book "Hacking Ubuntu: Serious Hacks Mods And Cusomtizations."

The default Ubuntu Dapper Drake installation includes some basic processes that check devices, tune the operating system, and perform housekeeping. Some of these processes are always running, while others start up periodically. Occasionally you might see your hard drive start up or grind away for a few minutes—what’s going on? On mission critical servers, serious gaming boxes, and other real-time systems, unexpected processes can cause huge problems; administrators should know exactly what is running and when. The last thing a time-sensitive application needs is for a resource-intensive maintenance system to start at an unexpected time and cause the system to slow down.

In order to fine-tune your system, you will need to know what is currently running, which resources are available, and when processes start up. From there, you can tweak configurations: disable undesirable processes, enable necessary housekeeping, and adjust your kernel to better handle your needs.

Time to Change
Different versions of Ubuntu (and Linux) use different startup scripts and run different support processes. Knowing how one version of Linux works does not mean that you know how all versions work. For example, one of my computers has a clock that loses a few minutes after every reboot. (It’s an old computer.) When I installed Ubuntu Dapper Drake (6.06), I noticed that the time was correct after a reboot. I started to look around to find out how it did that and which timeserver it was using. The first thing I noticed was that there was no script in /etc/init.d/ for setting the time. Eventually I tracked down the network startup scripts and found that the ntpdate script was moved from /etc/init.d/ (in previous Ubuntu releases) to /etc/network/if-up.d/. This script allowed me to find the network time protocol (NTP) configuration file (/etc/default/ntpdate).

A similar problem came up when I started running Ubuntu Hoary Hedgehog (5.04). Periodically the hard drives would grind when I was not doing anything. At other times it happened when I was running processes that were impacted by disk I/O—when the drives began to grind, the critical process would detect a processing problem. I quickly narrowed the disk grinding to updatedb—a caching program that works with slocate for quickly finding files. What I could not find was how this program was being started. Eventually I discovered that updatedb was started by anacron, an automated scheduler.

While it is important to know what is running, it is even more important to know how to track down running processes and tune them to your needs.

Learning the Lingo
Everything that runs on the system is a process. Processes are programs that perform tasks. The tasks may range from system maintenance to configuring plug-and-play devices and anything else the user needs. System processes manage keep the operating system running, whereas user processes handle user needs.

Many processes provide services for other processes. For example, a web server is a service for handling HTTP network requests. The web server may use one or more processes to perform its task. Some services are critical to the system’s operation. For example, if the system must support graphics but the X-Windows service is unavailable, then a critical service is missing.

Although most system processes are services, most user processes are applications. Applications consist of one or more processes for supporting user needs. For example, the Firefox web browser is an application that helps the user browse the web. In general, services start and end based on system needs, while applications start and end based on user needs.

None of these definitions—programs, processes, applications, and services—are very distinct. For example, the Gnome desktop consists of programs and processes that provide services to other programs and supports user needs. GDE can be called a set of programs, processes, applications, or services without any conflict.

When I talk about processes, I refer to anything that generates a running process identifier (see the next section for Viewing Running Processes). Programs are the executable files on the system that generate one or more processes. Users directly use applications, while the operating system uses services.

Continue reading

xp登陆后自动注销

刚刚给笔记本装的,因为thinkpad默认启动项目太多,于是删除了些,结果重新启动后,不停的登陆,自动注销,,按F8进入安全模式也不行。最后一次正确启动配置也不行。用administrator帐户,依然是同样的情况
仔细想想,当时自己顺手把C:WINDOWSsystem32userinit.exe这个从启动项里面删除,问题就应该是在这里。上网找找,发现原来windows启动的时候,winlogon.exe需要调用,不然就会出现登陆后马上注销,
解决方法:用w2k3 pe(windows PE 2003 sp1)的启动盘启动系统。运行。然后加入注册表如下字段:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon]
"Userinit"="C:WINDOWSsystem32userinit.exe,"
然后重新启动,问题解决

修改grub背景图片

a) Find gzipped, 640×480, 14 color only, xpm images (like the ones above).
b) Put the images in /boot/grub/splashimages/.
c) Rename the image you wish to use to ‘splash.xpm.gz’.
d) Make a link to /boot/grub/splashimages/splash.xpm.gz and put it in /boot/grub/.
e) Open /boot/grub/menu.lst and below the ‘Pretty colours’ section add a third line as below:

# Pretty colours
# color cyan/blue white/blue
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

(The hd0,1 refers to hard drive 1 partition 2 where my file system is installed. You’ll need to change those numbers if yours differs.)

f) That’s it. Restart to see the new eye candy. For more in depth explanations: GNU GRUB Splash Image Howto, GRUB splash Image Information or