SpamAssassin fails to start on CentOS 5.10

If you’re still running a CentOS 5.10 machine, you may notice that after recent updates SpamAssassin no longer works on your system. Trying to start it manually will get you a puzzling error:

Starting spamd: child process [12345] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 2588.

Manually running sa-update also triggers an error (albeit more detailed)…

Handling processes / services on hibernation / wakeup in CentOS

Hibernation is a great feature on any computer. It allows for a temporary pause in execution in which the system in question can be unplugged, cleaned, modified, or moved.

But what happens when some services don’t play nice and fail to resume properly from sleep? Fortunately, Linux’s power management utilities provide the necessary functionality…

Restarting USB subsystem in CentOS

After a long uptime specific (cheap) devices or components connected to the USB ports lock up or malfunction. Unplugging and plugging them usually fixes issues, but physical access to the system (especially a remote server) is neither always possible or desirable.

In cases like this, Linux (unlike Windows) can trigger a USB subsystem restart by deactivating and reactivating the USB controller(s).

Bash script to monitor and (re)start Webmin

Webmin (Virtualmin) has great service monitoring capabilities, restarting any failed services that it detects. Unfortunately, it cannot and does not monitor or restart itself it it crashes.

Still, since on (most) Linux systems it comes with a service manager, this can be used to check its status. The included bash script does this and restarts it if necessary…

Configure Munin to graph MySQL on CentOS 5/6 with Virtualmin

If you’re running a CentOS 5/6 VPS/Server with Virtualmin and installed Munin to graph the system stats, you’ll mostly likely notice that the generated graphs do not include MySQL.

This is expected behaviour since Virtualmin asks you to define a root password for your MySQL server (so it isn’t left unsecured out in the open), while Munin tries to read MySQL data using the root account and no password and fails.

But there’s an easy way to fix this…

Disable yum fastestmirror plugin on CentOS

The fastestmirror plugin may be useful at some points, but it can be a pain in the ass at others.
For example, I tried updating my CentOS installation today and because of the mirror caching it was downloading the updates at 30K/s. After disabling the plugin the speed from picking a different mirror jumped to 3MB/s.

To disable the plugin…

Console commands to hibernate and standby on CentOS

It’s great that Linux nowadays supports all the power management features available on computers. But it’s odd that beside the buttons to trigger standby/hibernate – which are only available in a graphical interface – there are no simple console commands to put the computer to sleep or into hibernation.

Erase RAID metadata from (previously used) disk

I recently attempted to install a fresh CentOS on a pair of recycled (previously used in a different linux sistem) hard disks.

Of course I got the classical message that the disks already had RAID metadata on them: “Disk contains BIOS metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sda”