]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: express Conflict in syslog.socket instead of emergency.service
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Fri, 29 Sep 2017 16:20:31 +0000 (17:20 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Fri, 29 Sep 2017 16:34:55 +0000 (17:34 +0100)
Note this commit only changes how the code is expressed; it does not change
the existence of any dependency.

The `Conflicts=` was added in 3136ec90, "Stop syslog.socket when entering
emergency mode".  The discussion in the issue #266 raised concerns that
this might be needed for other units, but failed to point out why
syslog.socket is special.  The reason is that syslog.socket has
DefaultDepedencies=no, so it does not get Requires=sysinit.target like
other socket units do.  But syslog.service does require sysinit.target,
among other things.

We don't have many socket, path, or timer units with
DefaultDependencies=no, and I don't think any of the triggered services
have such additional hard dependencies as syslog.service does.

It is much less confusing if we keep this `Conflicts=` in the same file as
the `DefaultDependencies=no` which made it necessary.

units/emergency.service.in
units/syslog.socket

index c60fd6e256d034f111be9d79657844b9e4c8d0dc..ddf7d4cbe2e956d5fe6bca643bdafa39c95f2594 100644 (file)
@@ -11,7 +11,6 @@ Documentation=man:sulogin(8)
 DefaultDependencies=no
 Conflicts=shutdown.target
 Conflicts=rescue.service
-Conflicts=syslog.socket
 Before=shutdown.target
 
 [Service]
index d3987cb9a877f91fd6136fb3af75651a7a4fd5bc..372e8fcd45a86877d1a3d3a50191463e2c0d2441 100644 (file)
@@ -10,10 +10,14 @@ Description=Syslog Socket
 Documentation=man:systemd.special(7)
 Documentation=https://www.freedesktop.org/wiki/Software/systemd/syslog
 DefaultDependencies=no
-Before=sockets.target shutdown.target
+Before=sockets.target
 
 # Don't allow logging until the very end
 Conflicts=shutdown.target
+Before=shutdown.target
+
+# Don't try to activate syslog.service if sysinit.target has failed.
+Conflicts=emergency.service
 
 [Socket]
 ListenDatagram=/run/systemd/journal/syslog