[ovs-dev] [PATCH] rhel: Stop managing the /run/openvswitch directory with systemd.
Markos Chandras
mchandras at suse.de
Tue Mar 27 09:39:59 UTC 2018
It appears that new systemd versions (tested with v237) changed the
way RuntimeDirectory option behaves. Upstream commit 3536f49e8fa2
("core: add {State,Cache,Log,Configuration}Directory=") modified the
RuntimeDirectory code to run before every ExecStart* command instead
of running it once per service file when the service is run as 'root'.
This breaks the ovsdb-server because after the chown command was applied,
the RuntimeDirectory code was executed again, effectively wiping the
/run/openvswitch directory and creating it again resulting in the
following problem.
|00002|daemon_unix|EMER|/var/run/openvswitch/ovsdb-server.pid.tmp: create failed (Permission denied)
Mar 19 16:37:20 susetest ovs-ctl[3045]: ovsdb-server: /var/run/openvswitch/ovsdb-server.pid.tmp: create failed (Permission denied)
Mar 19 16:37:20 susetest ovs-ctl[3045]: Starting ovsdb-server ... failed!
The ovs-lib code can already manage that directory for us so we can
remove these entries from the systemd file and let ovs-vsctl do it.
Cc: Aaron Conole <aconole at redhat.com>
Signed-off-by: Markos Chandras <mchandras at suse.de>
---
rhel/usr_lib_systemd_system_ovsdb-server.service | 3 ---
1 file changed, 3 deletions(-)
diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service
index 234d39355..ce496ec30 100644
--- a/rhel/usr_lib_systemd_system_ovsdb-server.service
+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
@@ -10,7 +10,6 @@ Type=forking
Restart=on-failure
EnvironmentFile=/etc/openvswitch/default.conf
EnvironmentFile=-/etc/sysconfig/openvswitch
-ExecStartPre=/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
--no-ovs-vswitchd --no-monitor --system-id=random \
--ovs-user=${OVS_USER_ID} \
@@ -19,5 +18,3 @@ ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
--ovs-user=${OVS_USER_ID} \
--no-monitor restart $OPTIONS
-RuntimeDirectory=openvswitch
-RuntimeDirectoryMode=0755
--
2.16.2
More information about the dev
mailing list