]> git.proxmox.com Git - mirror_ovs.git/commit
rhel: Use correct user in the logrotate configuration file
authorMarkos Chandras <mchandras@suse.de>
Wed, 8 Aug 2018 14:27:25 +0000 (17:27 +0300)
committerBen Pfaff <blp@ovn.org>
Wed, 8 Aug 2018 17:58:05 +0000 (10:58 -0700)
commitb096fa42ddc2ed69fa86b60a501bd3c34e767b7f
tree1057dfa231354cb640e822fdc754c430925f2a2a
parent52e20a3d6c8bc36b9edde6669739132523eaa7b6
rhel: Use correct user in the logrotate configuration file

The /var/log/openvswitch directory is owned by the openvswitch user but
logrotate could be running as root or as another user. As a result of
which, rpmlint prints the following warning when building the spec file
on SUSE Linux Enterprise:

openvswitch.x86_64: W: suse-logrotate-user-writable-log-dir /var/log/openvswitch openvswitch:openvswitch 0750
The log directory is writable by unprivileged users. Please fix the
permissions so only root can write there or add the 'su' option
to your logrotate config

In order to fix that, we should run the logrotate script as the same
user which runs the various Open vSwitch daemons. If this is a new
installation, then this user is the 'openvswitch' one, but if we are
upgrading from an older release, then the user is normally 'root'.
As such, we set the initial user to 'root' and we fix this up in the
%post scriptlet.

Cc: Aaron Conole <aconole@redhat.com>
Cc: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
rhel/etc_logrotate.d_openvswitch
rhel/openvswitch-fedora.spec.in
rhel/usr_lib_systemd_system_ovsdb-server.service