Since we use a floating user (user with dynamic userid) and floating
groups (groups with dynamic groupid), when you use bootc the uid/gid of
the directory may change and so it's necessary to be sure that the
uid/gid is updated each time you try to start the daemon.

ovsdb-server.service is the correct place to do that, since
ovs-vswitchd.service uses After=ovsdb-server.service and so it's always started
after it.

See https://github.com/bootc-dev/bootc/issues/673#issuecomment-2493912762

Signed-off-by: Timothy Redaelli <tredae...@redhat.com>
---
 rhel/usr_lib_systemd_system_ovsdb-server.service | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rhel/usr_lib_systemd_system_ovsdb-server.service 
b/rhel/usr_lib_systemd_system_ovsdb-server.service
index 558632320..43ea3a570 100644
--- a/rhel/usr_lib_systemd_system_ovsdb-server.service
+++ b/rhel/usr_lib_systemd_system_ovsdb-server.service
@@ -18,7 +18,8 @@ EnvironmentFile=-/run/openvswitch.useropts
 # OVS_USER_ID from default.conf or sysconfig.
 ExecStartPre=/usr/bin/rm -f /run/openvswitch.useropts
 
-ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /run/openvswitch 
/var/log/openvswitch
+ExecStartPre=-/usr/bin/chown -R ${OVS_USER_ID} \
+             /etc/openvswitch /run/openvswitch /var/log/openvswitch
 ExecStartPre=/bin/sh -c '/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'
 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to