]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
arch template: Fix systemd-sysctl service
authorJakub Sztandera <kubuxu@gmail.com>
Fri, 30 Oct 2015 11:05:44 +0000 (12:05 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 6 Nov 2015 22:36:44 +0000 (17:36 -0500)
The systemd-sysctl service includes condition that /proc/sys/ has to be read-write.
In lxc only /proc/sys/net/ is read-write which causes the condition to fail and service not to run.
This patch changes the check to /proc/sys/net/ and makes the service apply only rules that are in net tree.

Signed-off-by: Jakub Sztandera <kubuxu@gmail.com>
templates/lxc-archlinux.in

index ea4cfcbad574193e8f44fd682612fd9aaf0f362d..6ea80a788319920e8fa25a6b447367e7184c250d 100755 (executable)
@@ -113,6 +113,10 @@ done
 ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
 # enable sigpwr signal handling in systemd as otherwise lxc-stop won't work
 ln -s /usr/lib/systemd/system/poweroff.target /etc/systemd/system/sigpwr.target
+# fix systemd-sysctl service
+sed -e 's/^ConditionPathIsReadWrite=\/proc\/sys\/$/ConditionPathIsReadWrite=\/proc\/sys\/net\//' \
+    -e 's/^ExecStart=\/usr\/lib\/systemd\/systemd-sysctl$/ExecStart=\/usr\/lib\/systemd\/systemd-sysctl --prefix net/' \
+    -i /usr/lib/systemd/system/systemd-sysctl.service
 # initialize pacman keyring
 pacman-key --init
 pacman-key --populate archlinux