service: if logging start app with LD_PRELOAD & lib for line buffering
Using pipe automatically switches service to block buffering which kind
of breaks our logging. We won't get anything from stdout FD until the
buffer gets filled fully or the service exits. This makes log messages
appear with an unwanted delay.
This change adds a tiny libsetlbf.so switching stdout to line buffering
and uses this lib for every logging-enabled service started by procd.
We don't need any extra change for stderr as it's unbuffered by default.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Modified to use no buffering to align with stderr. Several cleanups.
Signed-off-by: Steven Barth <steven@midlink.org>