summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-07-06 23:37:11 +0200
committerSteven Barth <steven@midlink.org>2015-07-07 10:36:04 +0200
commit6f841e89dfe9200a6f3a2f93a9dd83f66f8ef550 (patch)
treec97c99efe03a6bcb985ed356cd92bae6fa819fb2 /CMakeLists.txt
parent8f33afd87f118bfea52f50f7787843b694a38e72 (diff)
downloadunitd-6f841e89dfe9200a6f3a2f93a9dd83f66f8ef550.tar
unitd-6f841e89dfe9200a6f3a2f93a9dd83f66f8ef550.zip
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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfa9413..6af17a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,13 @@ IF(APPLE)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF()
+
+ADD_LIBRARY(setlbf SHARED service/setlbf.c)
+INSTALL(TARGETS setlbf
+ LIBRARY DESTINATION lib
+)
+
+
SET(SOURCES procd.c signal.c watchdog.c state.c inittab.c rcS.c ubus.c system.c
service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
plug/coldplug.c plug/hotplug.c utils/utils.c)