summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Caamaño Ruiz <jcaamano@suse.com>2019-04-30 19:10:19 +0200
committerIlya Maximets <i.maximets@ovn.org>2020-09-15 21:44:05 +0200
commit2a0ad628bbab5de0c381d1ef1e46c82c37c2deba (patch)
tree020b7c448e7614a6715647664156e00519327534
parent7524d556ba20376448ef4d734ecae4052bb462fd (diff)
downloadopenvswitch-2a0ad628bbab5de0c381d1ef1e46c82c37c2deba.tar.gz
rhel: Fix logrotate group when dpdk is enabled.
Otherwise logrotate will fail to generate the rotated log files. Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--rhel/openvswitch-fedora.spec.in19
1 files changed, 10 insertions, 9 deletions
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index c70b65ce8..059313678 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -404,18 +404,19 @@ exit 0
%post
if [ $1 -eq 1 ]; then
- sed -i 's:^#OVS_USER_ID=:OVS_USER_ID=:' /etc/sysconfig/openvswitch
- sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/openvswitch
-
%if %{with dpdk}
- sed -i \
- 's@OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:hugetlbfs"@'\
- /etc/sysconfig/openvswitch
+ %define gname hugetlbfs
+%else
+ %define gname openvswitch
%endif
+ sed -i \
+ 's@^#OVS_USER_ID="openvswitch:openvswitch"@OVS_USER_ID="openvswitch:%{gname}"@'\
+ %{_sysconfdir}/sysconfig/openvswitch
+ sed -i 's:\(.*su\).*:\1 openvswitch %{gname}:' %{_sysconfdir}/logrotate.d/openvswitch
- # In the case of upgrade, this is not needed.
- chown -R openvswitch:openvswitch /etc/openvswitch
- chown -R openvswitch:openvswitch /var/log/openvswitch
+ # In the case of upgrade, this is not needed
+ chown -R openvswitch:openvswitch %{_sysconfdir}/openvswitch
+ chown -R openvswitch:%{gname} %{_localstatedir}/log/openvswitch
fi
%if 0%{?systemd_post:1}