apcupsd and reducing boot-time

This post would be putting up the settings which work for me in apcupsd as well as some tweaks/tricks which I got from Jon Dong’s thread on ubuntuforums which have resulted in some speedup to my boot up as well as discuss what further enhancements could be done to have faster boot-ups on the same.

The file I had shared of apcupsd.conf was slightly incomplete. This is the one which works for me on my APCUPS BR-800 IN

## apcupsd.conf v1.1 ##
# for apcupsd release 3.14.4 (18 May 2008) - debian
# "apcupsd" POSIX config file

UPSNAME Back-800
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd

NOLOGON disable

EVENTSFILE /var/log/apcupsd.events

UPSCLASS standalone
UPSMODE disable
STATFILE /var/log/apcupsd.status

Now while this take care of apcupsd (of course there’s much to know and discuss about it more but don’t have the tools or the time for that 😦 )

Anyway moving ahead, came to know of couple of tips which worked for me, so they might work for you.

To measure if there is any difference or not with the tips, I would first urge to install a small application called bootchart.

sudo aptitude install bootchart OR

sudo apt-get install bootchart OR

go to Synaptic and search and install bootchart.

It is always a good idea to have updated your repositories index before doing the same.

After bootchart is installed, shut down and then boot up the machine.

Look at /var/log/bootchart directory. You will find something like intrepid-20081103-1.png being listed.Intrepid is the version/distro I have, the next is the date and the next for me to keep track of as I do changes to the system.

What you are seeing is how bootchart actually looks


The next step involves GRUB. The Grand Unified Boot Loader. We have talked about it a bit in past. It basically takes command over from the BIOS and allows the user to choose which kernel image or Operating System to use. Most of the GNU/Linux

Ubuntu 8.10, kernel 2.6.27-7-generic
Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
Ubuntu 8.10, memtest86+

Click on e to edit, then click e again you will come to something like this

/vmlinuz-2.6.27-7-generic root=UUID=baa0d92f-3112-42ab-aaf7-b2e416dea782 ro

While the name and version of your kernel may be different, it would follow the same rule.

The next part the UUID is nothing but a randomly generated Universally Unique Identifier.Its basically a string of figures by which the system knows your hard disk. Its also known loosely as a label.

At the end of the line it says ro (which stands for read only) take a space and put profile so it looks like this :-

/vmlinuz-2.6.27-7-generic root=UUID=baa0d92f-3112-42ab-aaf7-b2e416dea782 ro profile

Now boot up the system. This time the boot would be slow, much slower then the average. Now shutdown and boot up and you will find that it took much shorter time to boot up.

While there is much more to be gained by using readahead I didn’t gain anything from it hence not using that tip.

b. The next tip is of disabling services from startup . There are essentially three ways of doing the same.

The first way is going through System > Services and disabling the services which are not needed therein. systemservices
bum The other way is using bum which is much more a nicer way of doing things. For this one would have to install bum.
Lastly there is sysvrc-conf which can be used in case the GUI is not working or you do not want to have a GUI interface. Again this application needs to be installed. sysrc-conf

Now one of the issues which I find is that many laptop utilities are installed by default in a desktop. Its unbelievable that in this day and age we are not able to figure out that laptop utilities wouldn’t be needed on a desktop.

If I look I’m sure I will find more but the simplest would be laptop-mode-tools and hotkey-setup.

laptop-mode-tools :- Scripts to spin down hard drive and save power.
Laptop mode is a Linux kernel feature that allows your laptop to save considerable power, by allowing the hard drive to spin down for longer periods of time. This package contains the userland scripts that are needed to enable laptop mode. It includes support for automatically enabling laptop mode when the computer is working on batteries. It also supports various other power management features, such as starting and stopping daemons depending on power mode, automatically hibernating if battery levels are too low, and adjusting terminal blanking and X11 screen blanking.

hotkey-setup:- auto-configures laptop hotkeys
This package will attempt to auto-detect your laptop hardware and then configure its hotkeys to produce useful keycodes. These can then be used by userspace applications.

In fact the whole booting procedure could be made much much smarter and leaner. Aren’t for example udevd + hotplug + hald good enough to know if a bluetooth dongle or something is there. Why does it need to start a bluetooth service each time?

And then of course, there is upstart which when used promises to have a faster boot-up.

The idea at the end of the day is not just faster boot-up but also reducing resource-consumption on the system as well. All out for now 🙂

Add to FacebookAdd to NewsvineAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Furl


2 thoughts on “apcupsd and reducing boot-time

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.