bruceg/daemontools-encore — pull request #24 by snakpak (2014-12-14 23:55:04+00:00)
Title: (Re)add DJB's original fifo program

This is a redux of my previous request. Well, actually it's a clean restart. This version sticks to the original fifo interface and works very well in conjuction with encore features.

As mentioned previously, this patch was motivated by the need to hold a named pipe open for use as an Nginx log target. And since Nginx opens and closes its logs for every entry, using multilog isn't feasible because it exits in such cases.

In my particular usage, I've created an nginx service directory and configured Nginx to use log/pipe as its log file.

>cat run
#!/bin/sh
exec >&2
exec nginx

>cat log/run
#!/bin/sh
exec cat log/log
#!/bin/sh
exec multilog t ./main

There's a bit more to it since I'm running nginx and fifo/multilog as different users, but those details aren't really relevant here. The point is that this is simple, it works, and it doesn't introduce all the potentially breakable parts of my previous attempt.