Skip to content

Commit 950d8fc

Browse files
committed
units: express Conflict in syslog.socket instead of emergency.service
Note this commit only changes how the code is expressed; it does not change the existence of any dependency. The `Conflicts=` was added in 3136ec9, "Stop syslog.socket when entering emergency mode". The discussion in the issue adamlaska#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.
1 parent a3b22cc commit 950d8fc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

units/emergency.service.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Documentation=man:sulogin(8)
1111
DefaultDependencies=no
1212
Conflicts=shutdown.target
1313
Conflicts=rescue.service
14-
Conflicts=syslog.socket
1514
Before=shutdown.target
1615

1716
[Service]

units/syslog.socket

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ Description=Syslog Socket
1010
Documentation=man:systemd.special(7)
1111
Documentation=https://www.freedesktop.org/wiki/Software/systemd/syslog
1212
DefaultDependencies=no
13-
Before=sockets.target shutdown.target
13+
Before=sockets.target
1414

1515
# Don't allow logging until the very end
1616
Conflicts=shutdown.target
17+
Before=shutdown.target
18+
19+
# Don't try to activate syslog.service if sysinit.target has failed.
20+
Conflicts=emergency.service
1721

1822
[Socket]
1923
ListenDatagram=/run/systemd/journal/syslog

0 commit comments

Comments
 (0)