Of those the start/stop/restart of ovsdb-server.service is the one creating/removing the directory of /var/run/openvswitch/. The latter ovs-vswitchd.service then re-uses that directory.
The path is created due to /lib/systemd/system/ovsdb-server.service:
RuntimeDirectory=openvswitch
RuntimeDirectoryMode=0755
Acoording to [1] that will be "In case of RuntimeDirectory= the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if RuntimeDirectoryPreserve= is configured to restart or yes (see below)"
So the behavior atm is exactly as configured.
The service files are "ours" (= packaging). Upstream only has rhel service files and those do not dynamically add/remove the path. Instead I've even seen discussions [2] saying about RuntimeDirectoryPreserve "We need to have this either as 'yes', or 'restart' - OVN daemons depend on this directory persisting even when the OVS daemons go away."
We can add a change via:
$ sudo systemctl edit ovsdb-server.service
[Service]
RuntimeDirectoryPreserve=yes
That will keep the directory alive and avoid the issue.
@Yi - for now that could be your solution as it would avoid having you to reconfigure (potentially many) other places.
Packaging wise that would be as easy as [3]
But I'm unsure if there is intention in removing this directory - e.g. to get the DB state cleaned and re-initialized for sure. I'd leave that up to James/Frode who have looked more at OVS. Based on their decision we can try to make this statement part of the default config (or not).
Subscribing James/Frode here on the bug and on the MP to carry on from here.
openvswitch-switch consists of three services actually:
openvswitch- switch. service (top level) service service
-> ovsdb-server.
-> ovs-vswitchd.
Of those the start/stop/restart of ovsdb-server. service is the one creating/removing the directory of /var/run/ openvswitch/ . The latter ovs-vswitchd. service then re-uses that directory.
The path is created due to /lib/systemd/ system/ ovsdb-server. service: y=openvswitch yMode=0755
RuntimeDirector
RuntimeDirector
Acoording to [1] that will be "In case of RuntimeDirectory= the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if RuntimeDirector yPreserve= is configured to restart or yes (see below)"
So the behavior atm is exactly as configured.
The service files are "ours" (= packaging). Upstream only has rhel service files and those do not dynamically add/remove the path. Instead I've even seen discussions [2] saying about RuntimeDirector yPreserve "We need to have this either as 'yes', or 'restart' - OVN daemons depend on this directory persisting even when the OVS daemons go away."
We can add a change via: service yPreserve= yes
$ sudo systemctl edit ovsdb-server.
[Service]
RuntimeDirector
That will keep the directory alive and avoid the issue.
@Yi - for now that could be your solution as it would avoid having you to reconfigure (potentially many) other places.
Packaging wise that would be as easy as [3]
But I'm unsure if there is intention in removing this directory - e.g. to get the DB state cleaned and re-initialized for sure. I'd leave that up to James/Frode who have looked more at OVS. Based on their decision we can try to make this statement part of the default config (or not).
Subscribing James/Frode here on the bug and on the MP to carry on from here.
[1]: https:/ /www.freedeskto p.org/software/ systemd/ man/systemd. exec.html /github. com/openvswitch /ovs/pull/ 247/files# r208172722 /code.launchpad .net/~paelzer/ ubuntu/ +source/ openvswitch/ +git/openvswitc h/+merge/ 395882
[2]: https:/
[3]: https:/