diff mbox series

[ovs-dev] Revert "rhel: Move conf.db to /var/lib/openvswitch, using symlinks."

Message ID 20221215130513.3472745-1-i.maximets@ovn.org
State Superseded
Headers show
Series [ovs-dev] Revert "rhel: Move conf.db to /var/lib/openvswitch, using symlinks." | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ilya Maximets Dec. 15, 2022, 1:05 p.m. UTC
This reverts commit 59e8cb8a053d50f49629be8b6fd614562d066404.

Commit broke the package install on a clean system and also doesn't
seem to manage access rights for created symlinks correctly.

Revert it until a proper solution is proposed.

Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2022-December/400045.html
Reported-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 rhel/openvswitch-fedora.spec.in | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

Comments

Ilya Maximets Dec. 20, 2022, 4:24 p.m. UTC | #1
On 12/15/22 14:05, Ilya Maximets wrote:
> This reverts commit 59e8cb8a053d50f49629be8b6fd614562d066404.
> 
> Commit broke the package install on a clean system and also doesn't
> seem to manage access rights for created symlinks correctly.
> 
> Revert it until a proper solution is proposed.
> 
> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2022-December/400045.html
> Reported-by: Roi Dayan <roid@nvidia.com>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  rhel/openvswitch-fedora.spec.in | 27 ++++-----------------------
>  1 file changed, 4 insertions(+), 23 deletions(-)
> 

Superseded by the actual fix:
  https://patchwork.ozlabs.org/project/openvswitch/patch/d7f650c4973284b713ce22c08d2b93468c835996.1671204586.git.tredaelli@redhat.com/
diff mbox series

Patch

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 4a3e6294b..de6cb30ea 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -238,6 +238,8 @@  rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
 
 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
 
+touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
+touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/.conf.db.~lock~
 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
 
 install -p -m 644 -D selinux/openvswitch-custom.pp \
@@ -326,27 +328,6 @@  if [ $1 -eq 1 ]; then
 fi
 %endif
 
-# Ensure that /etc/openvswitch/conf.db links to /var/lib/openvswitch,
-# moving an existing file if there is one.
-#
-# Ditto for .conf.db.~lock~.
-for base in conf.db .conf.db.~lock~; do
-    new=/var/lib/openvswitch/$base
-    old=/etc/openvswitch/$base
-    if test -f $old && test ! -e $new; then
-        mv $old $new
-    fi
-    if test ! -e $old && test ! -h $old; then
-        ln -s $new $old
-    fi
-    touch $new
-%if %{with dpdk}
-    chown openvswitch:hugetlbfs $new
-%else
-    chown openvswitch:openvswitch $new
-%endif
-done
-
 %if 0%{?systemd_post:1}
     # This may not enable openvswitch service or do daemon-reload.
     %systemd_post %{name}.service
@@ -432,8 +413,8 @@  fi
 %endif
 %dir %{_sysconfdir}/openvswitch
 %{_sysconfdir}/openvswitch/default.conf
-%config %ghost %{_sharedstatedir}/openvswitch/conf.db
-%ghost %{_sharedstatedir}/openvswitch/.conf.db.~lock~
+%config %ghost %{_sysconfdir}/openvswitch/conf.db
+%ghost %{_sysconfdir}/openvswitch/.conf.db.~lock~
 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
 %defattr(-,root,root)