Category Archives: Linux

64 bits is Too Many Bits

A seemingly simple move of NFS-exported home directories resulted in Apache suEXEC freaking out when referencing the new space. Here are the details and solution, because sometimes a debugging story is fun.
Continue reading

When bare ‘tee | command’ won’t suffice

In my 20 years of touching UNIX/Linux, I’d never had a need for this until today. If you search around for common search terms like ‘stdout to screen and file’, you are likely only to get basic information on how to use the UNIX/Linux tee command.

However, command | tee somefile.out loses the exit code of command if you care about checking it.

The bash solution provided by someone on my employer’s internal Linux mailing list is:

{ command; RESULT=$?; } | tee somefile.out

Though I also just learned that one can reference the PIPESTATUS array instead.

command | tee somefile.out
if [ $PIPESTATUS[0] -ne 0 ]; then
    echo "Error..."

Memory-backed Filesystem for Temporary Storage of Whisper Data

Instead of buying and installing SSDs, storing Graphite’s whisper files in a memory-backed filesystem can be a good way to go if you have the RAM to spare. Depending on your environment, you may or may not care about losing a few minutes (or hours) of metric data. I know we certainly don’t care about losing 30 minutes, so there’s no reason for our carbon-cache instances to be scrawling to persistent storage 24/7. Continue reading

Bootstrapping new Chef nodes without knife bootstrap

There may be a time when you don’t want to (or cannot) make use of knife bootstrap to set up a new Chef node or a whole fleet of hundreds of nodes. If that’s the case, and you already have a “hook” into the hosts you want to turn into Chef nodes (such as an existing CM tool), you have an option. Continue reading

Safer yum

We got sick of yum hanging on corrupt RPM databases.

Though @scoot suggests, instead, running a rebuild-if-needed cron job on all hosts instead of wrapping the yum command:

0 * * * * /usr/lib/rpm/rpmdb_verify /var/lib/rpm/[A-Z]* > /dev/null 2>&1 || rpm --rebuilddb

Pick your poison.