summaryrefslogtreecommitdiff
path: root/rhel
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:29:05 +0200
commitd3daf73db3e48d71a32839243e6ec323e02c0dd6 (patch)
treebee740ed469f4ae9b23e93e993c1855fde878928 /rhel
parent74aba1ff68178c371e450dc4a73b14d3026f89ef (diff)
downloadopenvswitch-d3daf73db3e48d71a32839243e6ec323e02c0dd6.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>
Diffstat (limited to 'rhel')
-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 e3e0d8acf..2c0c4fa18 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -318,18 +318,19 @@ exit 0
%post
%if %{with libcapng}
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
%endif