[systemd-devel] [PATCH] networkd: disable tmpfiles and sysusers bits associated with networkd
Ćukasz Stelmach
l.stelmach at samsung.com
Fri Nov 21 08:07:15 PST 2014
On a system configured without networkd and sysusers there still needs
to be the unnecessary systemd-network user, otherwise systemd-tmpfiles
fails to start.
Move information associated with networkd in tmpfiles.d and sysusers.d
to separate files. Do not install it if netwrorkd is not enabled.
---
Alternatively the files may be prepared to be processed with M4, which may
be useful to conditionaly include lines for other optional services.
Makefile.am | 10 ++++++++++
sysusers.d/systemd-networkd.conf | 8 ++++++++
sysusers.d/systemd.conf | 1 -
tmpfiles.d/systemd-networkd.conf | 12 ++++++++++++
tmpfiles.d/systemd.conf | 3 ---
5 files changed, 30 insertions(+), 4 deletions(-)
create mode 100644 sysusers.d/systemd-networkd.conf
create mode 100644 tmpfiles.d/systemd-networkd.conf
diff --git a/Makefile.am b/Makefile.am
index 3f9f3fa..8f0f290 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5164,6 +5164,16 @@ networkctl_LDADD = \
libsystemd-shared.la \
libsystemd-network.la
+if ENABLE_TMPFILES
+dist_tmpfiles_DATA += \
+ tmpfiles.d/systemd-networkd.conf
+endif
+
+if ENABLE_SYSUSERS
+dist_sysusers_DATA += \
+ sysusers.d/systemd-networkd.conf
+endif
+
test_network_SOURCES = \
src/network/test-network.c
diff --git a/sysusers.d/systemd-networkd.conf b/sysusers.d/systemd-networkd.conf
new file mode 100644
index 0000000..208148d
--- /dev/null
+++ b/sysusers.d/systemd-networkd.conf
@@ -0,0 +1,8 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+u systemd-network - "systemd Network Management"
diff --git a/sysusers.d/systemd.conf b/sysusers.d/systemd.conf
index 95437b8..3da0901 100644
--- a/sysusers.d/systemd.conf
+++ b/sysusers.d/systemd.conf
@@ -7,6 +7,5 @@
g systemd-journal - -
u systemd-bus-proxy - "systemd Bus Proxy"
-u systemd-network - "systemd Network Management"
u systemd-resolve - "systemd Resolver"
u systemd-timesync - "systemd Time Synchronization"
diff --git a/tmpfiles.d/systemd-networkd.conf b/tmpfiles.d/systemd-networkd.conf
new file mode 100644
index 0000000..2419755
--- /dev/null
+++ b/tmpfiles.d/systemd-networkd.conf
@@ -0,0 +1,12 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# See tmpfiles.d(5) for details
+
+d /run/systemd/netif 0755 systemd-network systemd-network -
+d /run/systemd/netif/links 0755 systemd-network systemd-network -
+d /run/systemd/netif/leases 0755 systemd-network systemd-network -
diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf
index 9ca5ad2..57fc261 100644
--- a/tmpfiles.d/systemd.conf
+++ b/tmpfiles.d/systemd.conf
@@ -16,9 +16,6 @@ d /run/systemd/sessions 0755 root root -
d /run/systemd/users 0755 root root -
d /run/systemd/machines 0755 root root -
d /run/systemd/shutdown 0755 root root -
-d /run/systemd/netif 0755 systemd-network systemd-network -
-d /run/systemd/netif/links 0755 systemd-network systemd-network -
-d /run/systemd/netif/leases 0755 systemd-network systemd-network -
d /run/log 0755 root root -
--
1.9.1
More information about the systemd-devel
mailing list