According to the metalog manpage, the /usr/sbin/metalog command should be given
the "--daemonize" option to run it in the background. However, the initscript
supplied does not use it.
The strange thing is that the initscript works normally out of the box. I only
discovered something was amiss when I added an option for starting metalog.
Since the start() function looks for extra options to metalog in the variable
METALOG_OPTS, I added this line near the beginning of the file:
METALOG_OPTS="--synchronous"
After adding that line, the initscript would hang after starting metalog. The
metalog daemons started normally, according to ps. However, the initscript
wasn't returning. This is the behavior I'd expect from reading the metalog and
start-stop-daemon manpages. I added "--daemonize" to the metalog options and it
works fine.
The only thing I can't figure out is why the initscript didn't freeze out of the
box. When I ran the whole start-stop-daemon command ( "start-stop-daemon --start
--quiet --exec /usr/sbin/metalog -- -p /var/run/metalog.pid") from the shell, it
blocked every time, though ps showed the daemons had started. When I then hit
Ctrl-C, the daemon would exit. Again, this is expected behavior; it's just
amazing the thing ever worked right.
Anyway, I'm sure "--daemonize" should be specified. I've attached my current
metalog initscript.