daandemeyer / rpms / systemd

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