valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0238-Revert-journald-move-dev-log-socket-to-run.patch

1ff636
From 4a1723115afea68db4cbe4f7f2d97c4f5663403d Mon Sep 17 00:00:00 2001
1ff636
From: Lukas Nykryn <lnykryn@redhat.com>
1ff636
Date: Thu, 6 Aug 2015 11:30:19 +0200
1ff636
Subject: [PATCH] Revert "journald: move /dev/log socket to /run"
1ff636
1ff636
This reverts commit 03ee5c38cb0da193dd08733fb4c0c2809cee6a99.
1ff636
1ff636
rhel-only
1ff636
1ff636
Resolves: #1249968
1ff636
---
1ff636
 Makefile-man.am                       |  5 -----
1ff636
 Makefile.am                           |  7 ++-----
1ff636
 man/systemd-journald.service.xml      |  2 --
1ff636
 src/core/namespace.c                  |  3 ++-
1ff636
 src/journal/journald-server.c         |  3 +--
1ff636
 src/journal/journald-syslog.c         |  2 +-
1ff636
 units/systemd-journald-dev-log.socket | 32 --------------------------------
1ff636
 units/systemd-journald.service.in     |  4 ++--
1ff636
 units/systemd-journald.socket         |  2 +-
1ff636
 9 files changed, 9 insertions(+), 51 deletions(-)
1ff636
 delete mode 100644 units/systemd-journald-dev-log.socket
1ff636
1ff636
diff --git a/Makefile-man.am b/Makefile-man.am
1ff636
index 084df75..497be66 100644
1ff636
--- a/Makefile-man.am
1ff636
+++ b/Makefile-man.am
1ff636
@@ -214,7 +214,6 @@ MANPAGES_ALIAS += \
1ff636
 	man/systemd-hybrid-sleep.service.8 \
1ff636
 	man/systemd-initctl.8 \
1ff636
 	man/systemd-initctl.socket.8 \
1ff636
-	man/systemd-journald-dev-log.socket.8 \
1ff636
 	man/systemd-journald.8 \
1ff636
 	man/systemd-journald.socket.8 \
1ff636
 	man/systemd-kexec.service.8 \
1ff636
@@ -326,7 +325,6 @@ man/systemd-hibernate.service.8: man/systemd-suspend.service.8
1ff636
 man/systemd-hybrid-sleep.service.8: man/systemd-suspend.service.8
1ff636
 man/systemd-initctl.8: man/systemd-initctl.service.8
1ff636
 man/systemd-initctl.socket.8: man/systemd-initctl.service.8
1ff636
-man/systemd-journald-dev-log.socket.8: man/systemd-journald.service.8
1ff636
 man/systemd-journald.8: man/systemd-journald.service.8
1ff636
 man/systemd-journald.socket.8: man/systemd-journald.service.8
1ff636
 man/systemd-kexec.service.8: man/systemd-halt.service.8
1ff636
@@ -616,9 +614,6 @@ man/systemd-initctl.html: man/systemd-initctl.service.html
1ff636
 man/systemd-initctl.socket.html: man/systemd-initctl.service.html
1ff636
 	$(html-alias)
1ff636
 
1ff636
-man/systemd-journald-dev-log.socket.html: man/systemd-journald.service.html
1ff636
-	$(html-alias)
1ff636
-
1ff636
 man/systemd-journald.html: man/systemd-journald.service.html
1ff636
 	$(html-alias)
1ff636
 
1ff636
diff --git a/Makefile.am b/Makefile.am
1ff636
index a81d3c1..58bcc2c 100644
1ff636
--- a/Makefile.am
1ff636
+++ b/Makefile.am
1ff636
@@ -4518,8 +4518,7 @@ bin_PROGRAMS += \
1ff636
 	systemd-cat
1ff636
 
1ff636
 dist_systemunit_DATA += \
1ff636
-	units/systemd-journald.socket \
1ff636
-	units/systemd-journald-dev-log.socket
1ff636
+	units/systemd-journald.socket
1ff636
 
1ff636
 nodist_systemunit_DATA += \
1ff636
 	units/systemd-journald.service \
1ff636
@@ -4538,9 +4537,7 @@ dist_catalog_DATA = \
1ff636
 	catalog/systemd.catalog
1ff636
 
1ff636
 SOCKETS_TARGET_WANTS += \
1ff636
-	systemd-journald.socket \
1ff636
-	systemd-journald-dev-log.socket
1ff636
-
1ff636
+	systemd-journald.socket
1ff636
 SYSINIT_TARGET_WANTS += \
1ff636
 	systemd-journald.service \
1ff636
 	systemd-journal-flush.service \
1ff636
diff --git a/man/systemd-journald.service.xml b/man/systemd-journald.service.xml
1ff636
index 8280d6c..fe99ce9 100644
1ff636
--- a/man/systemd-journald.service.xml
1ff636
+++ b/man/systemd-journald.service.xml
1ff636
@@ -45,7 +45,6 @@
1ff636
   <refnamediv>
1ff636
     <refname>systemd-journald.service</refname>
1ff636
     <refname>systemd-journald.socket</refname>
1ff636
-    <refname>systemd-journald-dev-log.socket</refname>
1ff636
     <refname>systemd-journald</refname>
1ff636
     <refpurpose>Journal service</refpurpose>
1ff636
   </refnamediv>
1ff636
@@ -53,7 +52,6 @@
1ff636
   <refsynopsisdiv>
1ff636
     <para><filename>systemd-journald.service</filename></para>
1ff636
     <para><filename>systemd-journald.socket</filename></para>
1ff636
-    <para><filename>systemd-journald-dev-log.socket</filename></para>
1ff636
     <para><filename>/usr/lib/systemd/systemd-journald</filename></para>
1ff636
   </refsynopsisdiv>
1ff636
 
1ff636
diff --git a/src/core/namespace.c b/src/core/namespace.c
1ff636
index d4f1c86..ebd5fb3 100644
1ff636
--- a/src/core/namespace.c
1ff636
+++ b/src/core/namespace.c
1ff636
@@ -187,7 +187,8 @@ static int mount_dev(BindMount *m) {
1ff636
         mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL);
1ff636
 
1ff636
         devlog = strjoina(temporary_mount, "/dev/log");
1ff636
-        symlink("/run/systemd/journal/dev-log", devlog);
1ff636
+        (void)touch(devlog);
1ff636
+        mount("/dev/log", devlog, NULL, MS_BIND, NULL);
1ff636
 
1ff636
         NULSTR_FOREACH(d, devnodes) {
1ff636
                 _cleanup_free_ char *dn = NULL;
1ff636
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
1ff636
index d692c06..fb7aae3 100644
1ff636
--- a/src/journal/journald-server.c
1ff636
+++ b/src/journal/journald-server.c
1ff636
@@ -1531,8 +1531,7 @@ int server_init(Server *s) {
1ff636
 
1ff636
                         s->stdout_fd = fd;
1ff636
 
1ff636
-                } else if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/dev/log", 0) > 0 ||
1ff636
-                           sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/run/systemd/journal/dev-log", 0) > 0) {
1ff636
+                } else if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, "/dev/log", 0) > 0) {
1ff636
 
1ff636
                         if (s->syslog_fd >= 0) {
1ff636
                                 log_error("Too many /dev/log sockets passed.");
1ff636
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
1ff636
index ba80941..4e118aa 100644
1ff636
--- a/src/journal/journald-syslog.c
1ff636
+++ b/src/journal/journald-syslog.c
1ff636
@@ -384,7 +384,7 @@ int server_open_syslog_socket(Server *s) {
1ff636
         if (s->syslog_fd < 0) {
1ff636
                 static const union sockaddr_union sa = {
1ff636
                         .un.sun_family = AF_UNIX,
1ff636
-                        .un.sun_path = "/run/systemd/journal/dev-log",
1ff636
+                        .un.sun_path = "/dev/log",
1ff636
                 };
1ff636
 
1ff636
                 s->syslog_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
1ff636
diff --git a/units/systemd-journald-dev-log.socket b/units/systemd-journald-dev-log.socket
1ff636
deleted file mode 100644
1ff636
index ffd44bb..0000000
1ff636
--- a/units/systemd-journald-dev-log.socket
1ff636
+++ /dev/null
1ff636
@@ -1,32 +0,0 @@
1ff636
-#  This file is part of systemd.
1ff636
-#
1ff636
-#  systemd is free software; you can redistribute it and/or modify it
1ff636
-#  under the terms of the GNU Lesser General Public License as published by
1ff636
-#  the Free Software Foundation; either version 2.1 of the License, or
1ff636
-#  (at your option) any later version.
1ff636
-
1ff636
-[Unit]
1ff636
-Description=Journal Socket (/dev/log)
1ff636
-Documentation=man:systemd-journald.service(8) man:journald.conf(5)
1ff636
-DefaultDependencies=no
1ff636
-Before=sockets.target
1ff636
-
1ff636
-# Mount and swap units need this. If this socket unit is removed by an
1ff636
-# isolate request the mount and swap units would be removed too,
1ff636
-# hence let's exclude this from isolate requests.
1ff636
-IgnoreOnIsolate=yes
1ff636
-
1ff636
-[Socket]
1ff636
-Service=systemd-journald.service
1ff636
-ListenDatagram=/run/systemd/journal/dev-log
1ff636
-Symlinks=/dev/log
1ff636
-SocketMode=0666
1ff636
-PassCredentials=yes
1ff636
-PassSecurity=yes
1ff636
-
1ff636
-# Increase both the send and receive buffer, so that things don't
1ff636
-# block early. Note that journald internally uses the this socket both
1ff636
-# for receiving syslog messages, and for forwarding them to any other
1ff636
-# syslog, hence we bump both values.
1ff636
-ReceiveBuffer=8M
1ff636
-SendBuffer=8M
1ff636
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
1ff636
index 1bcc290..9d44622 100644
1ff636
--- a/units/systemd-journald.service.in
1ff636
+++ b/units/systemd-journald.service.in
1ff636
@@ -10,12 +10,12 @@ Description=Journal Service
1ff636
 Documentation=man:systemd-journald.service(8) man:journald.conf(5)
1ff636
 DefaultDependencies=no
1ff636
 Requires=systemd-journald.socket
1ff636
-After=systemd-journald.socket systemd-journald-dev-log.socket syslog.socket
1ff636
+After=systemd-journald.socket syslog.socket
1ff636
 Before=sysinit.target
1ff636
 
1ff636
 [Service]
1ff636
 Type=notify
1ff636
-Sockets=systemd-journald.socket systemd-journald-dev-log.socket
1ff636
+Sockets=systemd-journald.socket
1ff636
 ExecStart=@rootlibexecdir@/systemd-journald
1ff636
 Restart=always
1ff636
 RestartSec=0
1ff636
diff --git a/units/systemd-journald.socket b/units/systemd-journald.socket
1ff636
index 7173701..fbeb10b 100644
1ff636
--- a/units/systemd-journald.socket
1ff636
+++ b/units/systemd-journald.socket
1ff636
@@ -19,8 +19,8 @@ IgnoreOnIsolate=yes
1ff636
 [Socket]
1ff636
 ListenStream=/run/systemd/journal/stdout
1ff636
 ListenDatagram=/run/systemd/journal/socket
1ff636
+ListenDatagram=/dev/log
1ff636
 SocketMode=0666
1ff636
 PassCredentials=yes
1ff636
 PassSecurity=yes
1ff636
 ReceiveBuffer=8M
1ff636
-Service=systemd-journald.service