mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
units: unify deps between service and socket units
The current arrangement of service and socket units is sort of all over the place. Let's clean it up a little, roughly following the principles below: - socket units have implicit ordering deps (not to be confused with default ones which are subject to DefaultDependencies=) before associated service, so drop any explicit After= - If socket can be enabled, remember to link to it in service via Also= and Sockets= (the latter replaces Wants=). If the service Requires= socket however, Sockets= is omitted. - If socket is statically enabled, no need for service to pull it in - machined
This commit is contained in:
@@ -12,7 +12,6 @@ Description=Disk Image Download Service
|
|||||||
Documentation=man:systemd-importd.service(8)
|
Documentation=man:systemd-importd.service(8)
|
||||||
Documentation=man:org.freedesktop.import1(5)
|
Documentation=man:org.freedesktop.import1(5)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=systemd-importd.socket
|
|
||||||
WantsMountsFor=/var/lib/machines /var/lib/portables /var/lib/extensions /var/lib/confexts
|
WantsMountsFor=/var/lib/machines /var/lib/portables /var/lib/extensions /var/lib/confexts
|
||||||
After=systemd-remount-fs.service
|
After=systemd-remount-fs.service
|
||||||
Before=shutdown.target
|
Before=shutdown.target
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ Description=Virtual Machine and Container Registration Service
|
|||||||
Documentation=man:systemd-machined.service(8)
|
Documentation=man:systemd-machined.service(8)
|
||||||
Documentation=man:org.freedesktop.machine1(5)
|
Documentation=man:org.freedesktop.machine1(5)
|
||||||
|
|
||||||
Wants=machine.slice systemd-machined.socket
|
Wants=machine.slice
|
||||||
After=machine.slice systemd-machined.socket
|
After=machine.slice
|
||||||
RequiresMountsFor=/var/lib/machines
|
RequiresMountsFor=/var/lib/machines
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Description=DDI File System Mounter
|
|||||||
Documentation=man:systemd-mountfsd.service(8)
|
Documentation=man:systemd-mountfsd.service(8)
|
||||||
Wants=modprobe@loop.service modprobe@dm_mod.service
|
Wants=modprobe@loop.service modprobe@dm_mod.service
|
||||||
Requires=systemd-mountfsd.socket
|
Requires=systemd-mountfsd.socket
|
||||||
After=systemd-mountfsd.socket modprobe@loop.service modprobe@dm_mod.service
|
After=modprobe@loop.service modprobe@dm_mod.service
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
Before=sysinit.target shutdown.target
|
Before=sysinit.target shutdown.target
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ Documentation=man:org.freedesktop.network1(5)
|
|||||||
ConditionCapability=CAP_NET_ADMIN
|
ConditionCapability=CAP_NET_ADMIN
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
# systemd-udevd.service can be dropped once tuntap is moved to netlink
|
# systemd-udevd.service can be dropped once tuntap is moved to netlink
|
||||||
After=systemd-networkd.socket systemd-udevd.service network-pre.target systemd-sysusers.service systemd-sysctl.service
|
After=systemd-udevd.service network-pre.target systemd-sysusers.service systemd-sysctl.service
|
||||||
Before=network.target multi-user.target shutdown.target initrd-switch-root.target
|
Before=network.target multi-user.target shutdown.target initrd-switch-root.target
|
||||||
Conflicts=shutdown.target initrd-switch-root.target
|
Conflicts=shutdown.target initrd-switch-root.target
|
||||||
Wants=systemd-networkd.socket network.target systemd-networkd-persistent-storage.service
|
Wants=network.target systemd-networkd-persistent-storage.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_BPF CAP_SYS_ADMIN
|
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_BPF CAP_SYS_ADMIN
|
||||||
@@ -46,6 +46,7 @@ RestrictRealtime=yes
|
|||||||
RestrictSUIDSGID=yes
|
RestrictSUIDSGID=yes
|
||||||
RuntimeDirectory=systemd/netif
|
RuntimeDirectory=systemd/netif
|
||||||
RuntimeDirectoryPreserve=yes
|
RuntimeDirectoryPreserve=yes
|
||||||
|
Sockets=systemd-networkd.socket
|
||||||
SystemCallArchitectures=native
|
SystemCallArchitectures=native
|
||||||
SystemCallErrorNumber=EPERM
|
SystemCallErrorNumber=EPERM
|
||||||
SystemCallFilter=@system-service bpf
|
SystemCallFilter=@system-service bpf
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
Description=Namespace Resource Manager
|
Description=Namespace Resource Manager
|
||||||
Documentation=man:systemd-nsresourced.service(8)
|
Documentation=man:systemd-nsresourced.service(8)
|
||||||
Requires=systemd-nsresourced.socket
|
Requires=systemd-nsresourced.socket
|
||||||
After=systemd-nsresourced.socket
|
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
Before=sysinit.target shutdown.target
|
Before=sysinit.target shutdown.target
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ ConditionPathExists=/proc/pressure/cpu
|
|||||||
ConditionPathExists=/proc/pressure/io
|
ConditionPathExists=/proc/pressure/io
|
||||||
ConditionPathExists=/proc/pressure/memory
|
ConditionPathExists=/proc/pressure/memory
|
||||||
Requires=systemd-oomd.socket
|
Requires=systemd-oomd.socket
|
||||||
After=systemd-oomd.socket systemd-sysusers.service
|
After=systemd-sysusers.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE
|
AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE
|
||||||
@@ -60,3 +60,4 @@ User=systemd-oom
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
Alias=dbus-org.freedesktop.oom1.service
|
Alias=dbus-org.freedesktop.oom1.service
|
||||||
|
Also=systemd-oomd.socket
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ Documentation=https://systemd.io/WRITING_NETWORK_CONFIGURATION_MANAGERS
|
|||||||
Documentation=https://systemd.io/WRITING_RESOLVER_CLIENTS
|
Documentation=https://systemd.io/WRITING_RESOLVER_CLIENTS
|
||||||
|
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=systemd-sysctl.service systemd-sysusers.service systemd-resolved-varlink.socket systemd-resolved-monitor.socket
|
After=systemd-sysctl.service systemd-sysusers.service
|
||||||
Before=sysinit.target network.target nss-lookup.target shutdown.target initrd-switch-root.target
|
Before=sysinit.target network.target nss-lookup.target shutdown.target initrd-switch-root.target
|
||||||
Conflicts=shutdown.target initrd-switch-root.target
|
Conflicts=shutdown.target initrd-switch-root.target
|
||||||
Wants=nss-lookup.target systemd-resolved-varlink.socket systemd-resolved-monitor.socket
|
Wants=nss-lookup.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE
|
||||||
@@ -45,6 +45,7 @@ RestrictRealtime=yes
|
|||||||
RestrictSUIDSGID=yes
|
RestrictSUIDSGID=yes
|
||||||
RuntimeDirectory=systemd/resolve
|
RuntimeDirectory=systemd/resolve
|
||||||
RuntimeDirectoryPreserve=yes
|
RuntimeDirectoryPreserve=yes
|
||||||
|
Sockets=systemd-resolved-varlink.socket systemd-resolved-monitor.socket
|
||||||
SystemCallArchitectures=native
|
SystemCallArchitectures=native
|
||||||
SystemCallErrorNumber=EPERM
|
SystemCallErrorNumber=EPERM
|
||||||
SystemCallFilter=@system-service
|
SystemCallFilter=@system-service
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
Description=User Database Manager
|
Description=User Database Manager
|
||||||
Documentation=man:systemd-userdbd.service(8)
|
Documentation=man:systemd-userdbd.service(8)
|
||||||
Requires=systemd-userdbd.socket
|
Requires=systemd-userdbd.socket
|
||||||
After=systemd-userdbd.socket
|
|
||||||
Before=sysinit.target
|
Before=sysinit.target
|
||||||
Wants=systemd-userdb-load-credentials.service
|
Wants=systemd-userdb-load-credentials.service
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|||||||
Reference in New Issue
Block a user