OpenBSD tip: Speed up boot time if you're running CUPS

| | Comments (0) |

cups.jpg

When I set up an OpenBSD box, I generally use CUPS — the Common Unix Printing System.

I've had pretty good luck with CUPS and OpenBSD, even though it can be a bit more hacky than usual to get your printers and PCs to come to an agreement and actually print something.

The last time I set up CUPS printing was with OpenBSD 4.4 on my Toshiba Satellite 1101-S101 laptop (the best OpenBSD platform I've had the pleasure of using, by the way).

I had already set up this OpenBSD install to pull packages from my local FTP mirror, after which I installed CUPS using pkg_add.

I can't clearly remember whether or not the install script automatically modified /etc/rc.local to launch the CUPS daemon at boot, but if it didn't the script at least told me what to put in that configuration file to get CUPS going.

The only "local daemon" I'm using is cupsd. Here's what my /etc/rc.local looked like at first:

# $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode. For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

echo -n 'starting local daemons:'

# Add your local startup actions here.

if [ -x /usr/local/sbin/cupsd ]; then
echo -n ' cupsd'; /usr/local/sbin/cupsd
fi

echo '.'

CUPS worked. I was able to set up networked printers both at home and at the office.

But during the boot sequence for OpenBSD, the machine would take a few minutes to load cupsd. A check of the script above shows that /usr/local/sbin/cupsd is not running in the background.

I used the & switch to change that. Here's what /etc/rc.local looks like now:

# $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode. For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

echo -n 'starting local daemons:'

# Add your local startup actions here.

if [ -x /usr/local/sbin/cupsd ]; then
echo -n ' cupsd'; /usr/local/sbin/cupsd &
fi

echo '.'

See the &? That allows cupsd to load in the background, and now when I start up OpenBSD, I don't have to wait for the CUPS server to start up before getting to a login prompt.

There couldn't be an easier hack to make OpenBSD run better.

Leave a comment

Tech Talk column

Steven Rosenberg's weekly Tech Talk column, which appears Saturdays in the Los Angeles Daily News, is now available on the Daily News Technology page.

About this blog

Comments are back: Comments have returned to Click, but due to the thousands of spam comments clogging up the system each day, commenters must now log in. To comment, either create a Movable Type account when prompted, or create and use a Typekey account. Movable Type, as configured on this blog, allows commenters to create a Movable Type account, verify it via e-mail and then sign in to comment. Other methods of verification are OpenID, Live Journal and Vox.




Steven Rosenberg aims to learn what he does not know. He writes about it here.



About this Entry

This page contains a single entry by Steven Rosenberg published on January 5, 2009 2:00 PM.

Small PCs come cheaper at PC Engines ... but you won't get a lot of RAM was the previous entry in this blog.

OpenBSD 4.4 doing well on the desktop in 768 MB of RAM is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Recent Comments

Powered by Movable Type 4.21-en

Advertisement