30 lines
779 B
Diff
30 lines
779 B
Diff
--- syslogd.c
|
|
+++ syslogd.c 2012/02/20 19:41:22
|
|
@@ -610,6 +610,10 @@ static char sccsid[] __attribute__ ((un
|
|
#define _PATH_LOG "/dev/log"
|
|
#endif
|
|
|
|
+#ifndef SYSTEMD_PATH_LOG
|
|
+#define SYSTEMD_PATH_LOG "/run/systemd/journal/syslog"
|
|
+#endif
|
|
+
|
|
char *ConfFile = _PATH_LOGCONF;
|
|
char *PidFile = _PATH_LOGPID;
|
|
char ctty[] = _PATH_CONSOLE;
|
|
@@ -936,6 +940,15 @@ int main(argc, argv)
|
|
funix[i] = -1;
|
|
}
|
|
|
|
+ /* systemd >= 38 wants we use /run/systemd/journal/syslog,
|
|
+ * instead of /dev/log, but allow to override it using -p */
|
|
+ if(sd_booted()) {
|
|
+ struct stat st;
|
|
+ if(stat(SYSTEMD_PATH_LOG, &st) != -1 && S_ISSOCK(st.st_mode)) {
|
|
+ funixn[0] = SYSTEMD_PATH_LOG;
|
|
+ }
|
|
+ }
|
|
+
|
|
while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:tvS")) != EOF)
|
|
switch((char)ch) {
|
|
case 'a':
|