Getting gnome-volume-manager to work again

Ok, its stuff like this that’s a real knock against linux being ready for the desktop. Since I’ve upgraded gnome recently, automounting of usb devices has stopped working. This is annoying, although livable. Today I found a fix, if you’re running debian with gnome and gnome-volume-manager still doesn’t display usb drives on your desktop when you connect, make sure that /usr/bin/pmount-hal is set suid root:

chmod u+s /usr/bin/pmount-hal

Unwanted auxprop related lines in logfiles

Since I configured my mail server, I was getting the following lines
in my auth.log.  Everything was working, users had to log in to
receive or send mail, so the messages were really cluttering the
logfile.

Nov 28 00:02:39 rm-003-11 lmtpunix[1085]: sql_select option missing<br />Nov 28 00:02:39 rm-003-11 lmtpunix[1085]: auxpropfunc error no mechanism available<br />Nov 28 00:05:44 rm-003-11 postfix/smtpd[1106]: sql_select option missing<br />Nov 28 00:05:44 rm-003-11 postfix/smtpd[1106]: auxpropfunc error no mechanism available<br />Nov 28 00:06:08 rm-003-11 postfix/smtpd[1108]: sql_select option missing

I wasn’t using auxprop as the method to check passwords, I am using
saslauth.  But googling around to find a way to get rid of them
did not find a solution.  On a hunch, I uninstalled the
libsasl2-modules-sql package for my Debian version, and the lines have
stopped showing up in the authentication logfile.  Everything is
still working, so that package wasn’t needed by my setup.

Cyrus Authentication

When setting up a Cyrus IMAP server and you want to use a MySql database to hold user names and passwords, you must use the mysql module for PAM to authenticate because it can handle passwords that are stored using crypt ( the ENCRYPT function in mysql ). While there is also the aux_prop plugin that supports looking the information up from the same source, it does not support crypt without patching. Especially if you’d rather install from packages than from the source code – ie, your time is valuable.

hating computers 2 day

I’ve been hating computers today as I woke up to find a corrupted partition table on my linux hard drive. I couldn’t recover it so had to balst away the partition table and all data on the drive. Luckily, all my data is redudantly backed up on other drives and PCs so I didn’t lose anything of real consequence. The major things that come to mind are some code updated I’d done to this blog and a web stats project I’d been working on sporadically.

On the bright side of things, I now have recovery down to a 3 hour proces to a usable machine. I’ve also got GNOME running with anti-aliasing, something I couldn’t get for some reason through the usual apt-get dist-upgrade methods.

Pointers: running your own mail server

There are a bunch of reasons why you might decide that running your own mail server is something you want to do. You have a lot of free time and enjoy spending a lot of time at the command line reading howto guides and installation manuals. Hopefully, you know you are running a mail server and don’t have a Windows machine that’s been turned into a spam zombie.

Ok, so that may not sound like good reasons. There are some real benefits, you can give yourself unlimited email aliases, give your friends and family easier-to-remember addresses, and set up mailing lists to keep in touch with people.

If you’ve got a linux server, Postfix is one of the more popular mail transports. One of the things about mail server jargon is that there are a number of lego blocks that go into the mail chain. I won’t attempt to write a complete guide to setting up your server, instead I’ll point you at some useful links that I found helpful, and to boot not horrendously diffult to install.

  • Postfix takes care of receiving incoming mail and routing it to a local destination. I found the Postfix Anti-UCE Cheat Sheet useful for making sure I had configured the server correctly to make sure it is being used for good and not evil.
  • Amavisd-new is a perl script for plugging in virus scanners and spam blocks into the delivery chain. I use Clam Anti-virus, a Free virus scanner, and Spamassassin, to protect users from unwanted or dangerous mail messages.
  • Once you’re system is running, you might find that you’re looking at the mail log to make sure nothing is out of sorts. Download pflogsumm and schedule it to send you a report on how many messages are being delivered/sent/blocked and other useful metrics.

mini-HOWTO: Netgear PS121 print server + Samsung ML1750 + Max OS X + Linux

Earlier this year, I bought the inexpensive Samsung ML-1750 black and white laser printer to replace the unused and old color inkjet I had. The printer worked nicely but it didn’t get much use since I had it connected to a Windows PC. Instead of sharing it through Samba and requiring a whole PC to be on whenever I needed to print, I picked up the Netgear PS121, a small print server. It has an ethernet port that gets connected to our network hub, and a USB port that hooks up to the printer. Out-of-the-box, as dreaded, it worked seamlessly with Windows but it took a little more effort to work with the alternative operating systems. Not that there’s anything wrong with that, but here’s what it took to get it all working.

Update the Netgear’s Firmware

Netgear has some good, basic support documents for troubleshooting problems on ther PS121 Support Page. You’ll want to make sure that your running the latest firmware. The instructions on that page for updating the firmware, which requires a windows machine, are lacking at best. After downloading and unpacking the utility and firmware zip files, you’re supposed to run the upgrade utility. Within the upgrade utility, find the printer server on your network, browse to the new firmware file, and hit upgrade. You’ll see a message indicating that the ps121’s eeprom is being rewritten. You’ll get a message indicating success when its done.

Test connections to the PS121

Before proceeding with installing the printer drivers, you want to verify that each computer on your network can connect to the printer server. The easiest way to do so is to bring up a web browser and connect to the IP address of the print server. If it’s working, you’ll be asked for the print server’s password and once authenticated you’ll see a page with the header "Netgear SmartWizard Manager, Mini Print Servers". If you can’t connect, you’ll need to troubleshoot the network connection from that computer to the server

Linux: CUPS and KDE Printing Manager

To print on a linux machine, you’ll need CUPS installed on your machine. Details for installing it will vary by distribution but on debian its as simple as "apt-get install cupsys". The KDE Control Center’s Printers applet provides a comfortable, GUI for setting up CUPS and installing a printer.

These are the settings I used to add the ML-1750 via PS121 as a printer.:

  • Printer Type: Remote LPD Queue
  • LPD Host: the IP address of the print server
  • LPD Queue: The serve name of the print server, you can get it by connecting to the IP address in a browser and looking at the Server Status page.
  • Driver: Samsung ML-1750 Froomatic/pxlmono, you’ll need to have all the foomatic packages installed.

That should do it, you can confim by sending a test page to print.

Mac OS X: CUPS & Ghostscript & Samsung GDI

On my Powerbook, things were a little trickier. On the Samsung site, there are newer print drivers for Max OS X that support 10.3.2 and higher which I downloaded and installed. I connected the printer directly via USB and confirmed that it could print that way. When adding the printer as a Remote LPD Queue however, the option to use the Samsung drivers would not appear. Since the ML-1750 doesn’t support Postscript, print jobs with that option resulted in wasted paper. CUPS is also installed and available, so using the Samsung-GDI drivers does the trick. Once you’ve installed the two packages on that page, a number of Samsung printers will appear as options for the driver. The connection settings are identical to the ones for linux above.

Printing from Thunderbird & Firefox, on Linux

While most apps printed, inexplicably I couldn’t print webpages or emails from Mozilla apps. The printer would show up as an option and I’d get no errors but also no printouts. Turns out, you can bypass the Mozilla settings and use the Kprint dialog for controlling printer settings by specifying kprinter --stdin as the Print Command. Full instructions are at KDE Printing in Mozilla.

Conclusion

Thanks to CUPS, printing on Linux has come a long way since I last struggled with it. You’ll still want to do the research at LinuxPrinting.org to make sure you buy a compatible printer but there is a wide variety of them out there. The fact the Apple has decided to use CUPS on its computers should also convince manufactures to provide CUPS-compatible drivers, and more importantly, serve both Linux and Mac users.

Tweaking Firefox & Thunderbird in Linux

Both on my Debian PC’s at home and work, I’ve been annoyed that my Firefox and Thunderbird installations didn’t launch each other when I clicked on a link or email address. For example, at work, Evolution would come up if I clicked on a mailto link on a web page. Inside each program’s preferences there were no options for controlling this behavior. These preferences are set in the gnome-control-center. Each application will respect the preferred browser and preferred email programs defined in there. I forgot where I found this tip recently but I can’t take credit for discovering it on my own.

Rotating Log Files

If you’re not careful with how you handle log files on your server, you may be surprised one day if it crashes because the file grows to the file size limit on your operating system. To prevent that, you’ll want to implement some sort of log rotation system. On most linux distributions, this is most commonly handled by LogRotate which runs as a daily cronjob.

One minor drawback to logrotate is that you have to list explicitly which logs to rotate in its configuration files. This can be pretty tedious once Apache serving more than a handful of sites. One solution is to log all trafic to your virtual hosts to a single file, but I like each site to have its own logfiles. In the past, I had put together a quick little script that would rotate scripts for me at the begining of each month but this also requires adding a new host to the list of logs to rotate.. Since I didn’t want to have to remember another step when setting up sites on my server, I decided to look for other options for rotating the apache logs on a monthly basis. I found cronolog, which is a clever little program:

cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened.

The program was easy to download and compile from source. Now, when setting up a virtual host, instead of using lines like the following:

CustomLog /www/hosts/oscarm.org/logs/access.log combined

I simply use the following to get automagically rotating logs with the year and month at the beggining of the filename (note the quotes and pipe at the beginning):

CustomLog &quot;|/path/to/cronolog /www/hosts/oscarm.org/logs/%Y-%m.access.log&quot; combined<br />

On a related topic, if you are writing web applications and logging any errors or output yourself, you’d be wise to rotate logs as well and not expect your server admin to know to do it for you. In PHP, this is trivially easy using the date function when you specify what file to log to. Instead of doing:

$logfile = &quot;/path/to/my_logfile.log&quot;

You should do this:

$logfile = &quot;/path/to/&quot;.date('Y-m').&quot;.my_logfile.log&quot;