diff options
author | Jaime Caamaño Ruiz <jcaamano@suse.com> | 2019-06-10 15:55:31 +0200 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-06-10 13:50:57 -0700 |
commit | 7a65e5a9252ac06df62707a571931f501747ecfc (patch) | |
tree | f3685952de1dce38232e9e4f8b0fbf70b631dfee /rhel | |
parent | 0d5dd7c2d57b632f009f134547a7ef1f351d59af (diff) | |
download | openvswitch-7a65e5a9252ac06df62707a571931f501747ecfc.tar.gz |
rhel: let *-ctl handle runtime directory
Recent versions of systemd restores RuntimeDirectory ownership to the
unit's User in between execution of *Exec directives (see [1]). Using
ExecStartPre to reset RuntimeDirectory ownership to OVS_USER no longer
works as expected.
The ctl scripts already handle creation of the runtime directory with
correct ownership and permissions so we can basically remove
RuntimeDirectory from systemd unit file. There is still need to handle
ownsership to cover some upgrade scenarios, but success of that will be
optional as the directory itself wont exist at first time run.
[1] https://github.com/systemd/systemd/issues/12713
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'rhel')
-rw-r--r-- | rhel/usr_lib_systemd_system_ovsdb-server.service | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service b/rhel/usr_lib_systemd_system_ovsdb-server.service index 3ca813d04..4c170c09b 100644 --- a/rhel/usr_lib_systemd_system_ovsdb-server.service +++ b/rhel/usr_lib_systemd_system_ovsdb-server.service @@ -11,7 +11,7 @@ PIDFile=/var/run/openvswitch/ovsdb-server.pid Restart=on-failure EnvironmentFile=/etc/openvswitch/default.conf EnvironmentFile=-/etc/sysconfig/openvswitch -ExecStartPre=/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch +ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /var/run/openvswitch /var/log/openvswitch ExecStartPre=/bin/sh -c 'rm -f /run/openvswitch.useropts; /usr/bin/echo "OVS_USER_ID=${OVS_USER_ID}" > /run/openvswitch.useropts' ExecStartPre=/bin/sh -c 'if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVS_USER_OPT=--ovs-user=${OVS_USER_ID}" >> /run/openvswitch.useropts; fi' EnvironmentFile=-/run/openvswitch.useropts @@ -23,5 +23,3 @@ ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \ ${OVS_USER_OPT} \ --no-monitor restart $OPTIONS -RuntimeDirectory=openvswitch -RuntimeDirectoryMode=0755 |