Bug 1589668

Summary: error: Ignoring osad because of bad file mode - must be 0644 or 0444.
Product: [Community] Spacewalk Reporter: Thomas Schweikle <tschweikle>
Component: ClientsAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.7CC: laurence.rochfort, sbr, tschweikle
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-15 07:59:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1653216    

Description Thomas Schweikle 2018-06-11 06:40:20 UTC
Description of problem:
Since latest stable spacewalk installs osad with logrotate /etc/logrotate.d/osad:
/var/log/osad {
    weekly
    rotate 5
    copytruncate
    compress
    notifempty
    missingok
    size 100M
}

Logrotate ignores /var/log/osad rotating logs, because of bad file mode:
# ll /var/log/osad*
-rw------- 1 root root 2376628 10. Jun 23:00 /var/log/osad

Logrotate awaits /var/log/osad having mode 0644 or 0444 and user:group root:root.
I can indeed add a line "create 0600 root root" but this does not help. Logrotate will further ignore the file with the very same message.

Version-Release number of selected component (if applicable):
osa-common-5.11.74-1.el7.noarch
osad-5.11.74-1.el7.noarch
logrotate-3.8.6-15.el7.x86_64

How reproducible:
Always on various systems

Steps to Reproduce:
1. Install latest stable osad, logrotate
2. Start osad, wait for logrotate to rotate osad logs

Actual results:
Logrotate does not rotate logs because of bad file mode 0600. It wants 0644 or 0444

Expected results:
Logrotate rotating osad logs

Additional info:
Since logrotate with line "create 0644 root root" must work, but does not, it may be a bug within logrotate, not osad. But at least, osad supplied /etc/logrotate.d/osad should hold a line "create 0600 root root". This is missing from the supplied file.

Comment 1 Thomas Schweikle 2018-06-11 06:41:23 UTC
Found the same within Spacewalk 2.8. But not within Spacewalk 2.6.

Comment 2 Sven Broeker 2018-06-12 06:47:27 UTC
This failure is already in 2.6 and 2.7. That filemodeerror refers not the Logfile, it refers the configuration for the logrotate. 

Fix:
change filemodeerror from /etc/logrotate.d/osad to 0644 or 0444

Comment 3 Sven Broeker 2018-06-12 06:48:29 UTC
copy paste failure. 

Fix:
change filemode from /etc/logrotate.d/osad to 0644 or 0444

Comment 4 Tomáš Kašpárek 2018-06-19 06:46:36 UTC
Hello,

can you please paste exact version of osad you're using? (rpm -q osad)
With osad-5.11.102-1.el6 I am having following file mode for /etc/logrotate.d/osad
-rw-r--r--. 1 root root 115 Mar 20 06:59 /etc/logrotate.d/osad

Which seems OK to me.

Comment 5 Sven Broeker 2018-06-19 07:40:17 UTC
I've installed it fresh from 2.7 releases:

[root@7b68f4e74bec /]# ll /etc/logrotate.d/
total 12
-rw-rw-r--  1 root root 115 Aug 10  2017 osad
-rw-r--r--  1 root root  32 Aug  9  2017 up2date
-rw-r--r--. 1 root root 100 Jan 30 13:51 yum
[root@7b68f4e74bec /]# rpm -qa osad
osad-5.11.89-1.el7.noarch
[root@7b68f4e74bec /]# logrotate  -f /etc/logrotate.conf
error: Ignoring osad because of bad file mode - must be 0644 or 0444.
[root@7b68f4e74bec /]#


from 2.6 releases(this is the version we actually using)
[root@a2123f9557a0 /]# ll /etc/logrotate.d/
total 12
-rw-rw-r--  1 root root 115 Nov 14  2016 osad
-rw-r--r--  1 root root  32 Nov 15  2016 up2date
-rw-r--r--. 1 root root 100 Jan 30 13:51 yum
[root@a2123f9557a0 /]# rpm -qa osad
osad-5.11.74-1.el7.noarch

Comment 6 Laurence Rochfort 2018-07-05 08:40:15 UTC
Fix submitted in PR 658

https://github.com/spacewalkproject/spacewalk/pull/658

Comment 7 Tomáš Kašpárek 2018-07-09 09:52:42 UTC
spacewalk.git(master): b218ba9fd9eccf4f9b62aed91f48501f970a9974

Comment 8 Michael Mráka 2018-11-26 09:43:53 UTC
Move Spacewalk 2.9 bugs ON_QA.

Comment 9 Michael Mráka 2019-01-15 07:59:22 UTC
Spacewalk 2.9 has been released.
https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes29

Comment 10 Thomas Schweikle 2019-12-23 16:44:40 UTC
Logrotate awaits rights on configuration files 0644 or 0444. Spacewalk did not install them with these and only these rights.