summaryrefslogtreecommitdiffstats
path: root/plugins/imuxsock/imuxsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/imuxsock/imuxsock.c')
-rw-r--r--plugins/imuxsock/imuxsock.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index feddb20c..4523798f 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -67,6 +67,12 @@ MODULE_TYPE_NOKEEP
#define _PATH_LOG "/dev/log"
#endif
#endif
+#ifndef SYSTEMD_JOURNAL
+#define SYSTEMD_JOURNAL "/run/systemd/journal"
+#endif
+#ifndef SYSTEMD_PATH_LOG
+#define SYSTEMD_PATH_LOG SYSTEMD_JOURNAL "/syslog"
+#endif
/* emulate struct ucred for platforms that do not have it */
#ifndef HAVE_SCM_CREDENTIALS
@@ -775,6 +781,12 @@ CODESTARTwillRun
# endif
if(pLogSockName != NULL)
listeners[0].sockName = pLogSockName;
+ else if(sd_booted()) {
+ struct stat st;
+ if(stat(SYSTEMD_JOURNAL, &st) != -1 && S_ISDIR(st.st_mode)) {
+ listeners[0].sockName = SYSTEMD_PATH_LOG;
+ }
+ }
if(ratelimitIntervalSysSock > 0) {
if((listeners[0].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) {
/* in this case, we simply turn of rate-limiting */