diff mbox series

[ovs-dev] rhel: fix logrotate user config option

Message ID 20220322173704.3253691-1-odivlad@gmail.com
State Accepted
Headers show
Series [ovs-dev] rhel: fix logrotate user config option | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Vladislav Odintsov March 22, 2022, 5:37 p.m. UTC
If rpm is built with libcapng (default), /etc/logrotate.d/ovn
config file user is SEDed in postinstall section with 'ovn ovn'.

If one run logrotate, next error occurs:
```
[root@host ~]# logrotate /etc/logrotate.d/ovn
error: /etc/logrotate.d/ovn:9 unknown user 'ovn'
error: found error in /var/log/ovn/*.log , skipping
```

Replace 'ovn' user with 'openvswitch' to fix the issue.

Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
---
 rhel/ovn-fedora.spec.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Michelson March 22, 2022, 6:33 p.m. UTC | #1
Acked-by: Mark Michelson <mmichels@redhat.com>

On 3/22/22 13:37, Vladislav Odintsov wrote:
> If rpm is built with libcapng (default), /etc/logrotate.d/ovn
> config file user is SEDed in postinstall section with 'ovn ovn'.
> 
> If one run logrotate, next error occurs:
> ```
> [root@host ~]# logrotate /etc/logrotate.d/ovn
> error: /etc/logrotate.d/ovn:9 unknown user 'ovn'
> error: found error in /var/log/ovn/*.log , skipping
> ```
> 
> Replace 'ovn' user with 'openvswitch' to fix the issue.
> 
> Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
> ---
>   rhel/ovn-fedora.spec.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
> index 3fb854a37..821eb03cc 100644
> --- a/rhel/ovn-fedora.spec.in
> +++ b/rhel/ovn-fedora.spec.in
> @@ -323,7 +323,7 @@ ln -sf ovn_detrace.py %{_bindir}/ovn-detrace
>   %if %{with libcapng}
>   if [ $1 -eq 1 ]; then
>       sed -i 's:^#OVN_USER_ID=:OVN_USER_ID=:' %{_sysconfdir}/sysconfig/ovn
> -    sed -i 's:\(.*su\).*:\1 ovn ovn:' %{_sysconfdir}/logrotate.d/ovn
> +    sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/ovn
>   fi
>   %endif
>   
>
Numan Siddique March 24, 2022, 2:54 p.m. UTC | #2
On Tue, Mar 22, 2022 at 2:33 PM Mark Michelson <mmichels@redhat.com> wrote:
>
> Acked-by: Mark Michelson <mmichels@redhat.com>
>

Thanks.

I applied this patch to the main branch and backported upto branch-21.03.

Numan
> On 3/22/22 13:37, Vladislav Odintsov wrote:
> > If rpm is built with libcapng (default), /etc/logrotate.d/ovn
> > config file user is SEDed in postinstall section with 'ovn ovn'.
> >
> > If one run logrotate, next error occurs:
> > ```
> > [root@host ~]# logrotate /etc/logrotate.d/ovn
> > error: /etc/logrotate.d/ovn:9 unknown user 'ovn'
> > error: found error in /var/log/ovn/*.log , skipping
> > ```
> >
> > Replace 'ovn' user with 'openvswitch' to fix the issue.
> >
> > Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
> > ---
> >   rhel/ovn-fedora.spec.in | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
> > index 3fb854a37..821eb03cc 100644
> > --- a/rhel/ovn-fedora.spec.in
> > +++ b/rhel/ovn-fedora.spec.in
> > @@ -323,7 +323,7 @@ ln -sf ovn_detrace.py %{_bindir}/ovn-detrace
> >   %if %{with libcapng}
> >   if [ $1 -eq 1 ]; then
> >       sed -i 's:^#OVN_USER_ID=:OVN_USER_ID=:' %{_sysconfdir}/sysconfig/ovn
> > -    sed -i 's:\(.*su\).*:\1 ovn ovn:' %{_sysconfdir}/logrotate.d/ovn
> > +    sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/ovn
> >   fi
> >   %endif


> >
> >
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Vladislav Odintsov March 24, 2022, 9:32 p.m. UTC | #3
Thanks Numan.

Regards,
Vladislav Odintsov

> On 24 Mar 2022, at 17:54, Numan Siddique <numans@ovn.org> wrote:
> 
> On Tue, Mar 22, 2022 at 2:33 PM Mark Michelson <mmichels@redhat.com> wrote:
>> 
>> Acked-by: Mark Michelson <mmichels@redhat.com>
>> 
> 
> Thanks.
> 
> I applied this patch to the main branch and backported upto branch-21.03.
> 
> Numan
>> On 3/22/22 13:37, Vladislav Odintsov wrote:
>>> If rpm is built with libcapng (default), /etc/logrotate.d/ovn
>>> config file user is SEDed in postinstall section with 'ovn ovn'.
>>> 
>>> If one run logrotate, next error occurs:
>>> ```
>>> [root@host ~]# logrotate /etc/logrotate.d/ovn
>>> error: /etc/logrotate.d/ovn:9 unknown user 'ovn'
>>> error: found error in /var/log/ovn/*.log , skipping
>>> ```
>>> 
>>> Replace 'ovn' user with 'openvswitch' to fix the issue.
>>> 
>>> Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
>>> ---
>>>  rhel/ovn-fedora.spec.in | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
>>> index 3fb854a37..821eb03cc 100644
>>> --- a/rhel/ovn-fedora.spec.in
>>> +++ b/rhel/ovn-fedora.spec.in
>>> @@ -323,7 +323,7 @@ ln -sf ovn_detrace.py %{_bindir}/ovn-detrace
>>>  %if %{with libcapng}
>>>  if [ $1 -eq 1 ]; then
>>>      sed -i 's:^#OVN_USER_ID=:OVN_USER_ID=:' %{_sysconfdir}/sysconfig/ovn
>>> -    sed -i 's:\(.*su\).*:\1 ovn ovn:' %{_sysconfdir}/logrotate.d/ovn
>>> +    sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/ovn
>>>  fi
>>>  %endif
> 
> 
>>> 
>>> 
>> 
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
index 3fb854a37..821eb03cc 100644
--- a/rhel/ovn-fedora.spec.in
+++ b/rhel/ovn-fedora.spec.in
@@ -323,7 +323,7 @@  ln -sf ovn_detrace.py %{_bindir}/ovn-detrace
 %if %{with libcapng}
 if [ $1 -eq 1 ]; then
     sed -i 's:^#OVN_USER_ID=:OVN_USER_ID=:' %{_sysconfdir}/sysconfig/ovn
-    sed -i 's:\(.*su\).*:\1 ovn ovn:' %{_sysconfdir}/logrotate.d/ovn
+    sed -i 's:\(.*su\).*:\1 openvswitch openvswitch:' %{_sysconfdir}/logrotate.d/ovn
 fi
 %endif