Thursday, March 22, 2012

It's not a bug if you would just use the undocumented feature...

At work I maintain an apt-mirror for Debian and Ubuntu.  Occasionally I like to check the status of an update by monitoring the apt-log.* files as follows:
tail -f /home/apt/var/apt-log.*
Which until recently would tail the output of all the log files and then sleep for 1 second.  A new feature of tail, part of the coreutils package, is inotify support. This is a nice feature when tailing a single file as updates to the file are displayed in realtime.  However when tailing multiple files that are constantly being updated it becomes an incomprehensible mess.

No problem, the man page says that -s allows you to specify a sleep interval.  Except that this option does not disable inotify and is effectively ignored.  Surely this must be a bug, and I am not the only who has thought so. (583198)

What really irks me, and the reason I wrote this post, is the following statement:
use the deliberately undocumented ---disable-inotify
So instead of a simple "if -s then disable inotify" which logically follows the intent of the command if the user is specifying a sleep interval we are told to use an option that is only apparent if you read the source code because it was intentionally undocumented.