mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
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:
1 parent
47d89ba2f6
commit
272db0d41d
1 file changed
+2
-1
+2
-1
@@ -217,9 +217,10 @@ static int lredirect(svc_t *svc)
|
|||||||
snprintf(num, sizeof(num), "%d", logfile_count_max);
|
snprintf(num, sizeof(num), "%d", logfile_count_max);
|
||||||
|
|
||||||
execlp("logit", "logit", "-f", svc->log.file, "-n", sz, "-r", num, NULL);
|
execlp("logit", "logit", "-f", svc->log.file, "-n", sz, "-r", num, NULL);
|
||||||
_exit(0);
|
|
||||||
#else
|
#else
|
||||||
logit(LOG_INFO, "logit disabled, logging %s to syslog instead", svc->name);
|
logit(LOG_INFO, "logit disabled, logging %s to syslog instead", svc->name);
|
||||||
|
fallback_logger(tag, prio);
|
||||||
|
_exit(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user