Use fallback to syslog if logit tool is not installed

In the case of redirect to a logfile, if logit tool is not enabled,
then log to syslog instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-15 08:00:24 +01:00
parent 47d89ba2f6
commit 272db0d41d
+2 -1
View File
@@ -217,9 +217,10 @@ static int lredirect(svc_t *svc)
snprintf(num, sizeof(num), "%d", logfile_count_max);
execlp("logit", "logit", "-f", svc->log.file, "-n", sz, "-r", num, NULL);
_exit(0);
#else
logit(LOG_INFO, "logit disabled, logging %s to syslog instead", svc->name);
fallback_logger(tag, prio);
_exit(0);
#endif
}