Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #9249] logrotate fails since the "su" directive was removed #2998

Closed
icinga-migration opened this issue May 11, 2015 · 8 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented May 11, 2015

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9249

Created by purplecarrot on 2015-05-11 14:50:34 +00:00

Assignee: purplecarrot
Status: Resolved (closed on 2016-03-29 13:00:06 +00:00)
Target Version: 2.4.5
Last Update: 2016-04-20 08:15:49 +00:00 (in Redmine)

Icinga Version: 2.3.4
Backport?: Already backported
Include in Changelog: 1

The following commit messes with logrotate because of the su removal: https://dev.icinga.org/projects/i2/repository/revisions/a28369593a1bc74ae20db55a643d2bac4cd8a0f2
Since then, logrotate throws errors

error: skipping "/var/log/icinga2/icinga2.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/icinga2/debug.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/icinga2/error.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

Attachments

Changesets

2016-03-29 12:59:06 +00:00 by purplecarrot 4970c45

Re-add the 'su' directive to logrotate if supported

- try to detect a recent logrotate version which supports the 'su'
directive (added in 3.8.0, see
https://github.com/logrotate/logrotate/commit/5be96cf1822496f80227e9a446281c3fa42e7b67#diff-e4eb329834da3d36278b1b7d943b3bc9R6)
- if logrotate can't be found, assume an old version is used
- allow the parameter to be forced by the user

fixes #9249

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>

2016-04-20 08:07:24 +00:00 by purplecarrot 45786e2

Re-add the 'su' directive to logrotate if supported

- try to detect a recent logrotate version which supports the 'su'
directive (added in 3.8.0, see
https://github.com/logrotate/logrotate/commit/5be96cf1822496f80227e9a446281c3fa42e7b67#diff-e4eb329834da3d36278b1b7d943b3bc9R6)
- if logrotate can't be found, assume an old version is used
- allow the parameter to be forced by the user

fixes #9249

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>

Relations:

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2015

Updated by mwaldmueller on 2015-05-12 06:47:19 +00:00

It works if you add a "su" line before the "create" line in /etc/logrotate.d/icinga2:

+ su icinga icinga
   create 644 icinga icinga
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2015

Updated by purplecarrot on 2015-05-12 07:27:05 +00:00

  • File added 0001-Fix-logrotate-errors.patch

Yeah, adding back these two lines work. Here's a patch.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2015

Updated by mfriedrich on 2015-05-12 07:57:41 +00:00

  • Category set to Installation
  • Status changed from New to Assigned
  • Assigned to set to purplecarrot

That won't work on Ubuntu 12.04 LTS - see #8190.

The clean fix is to determine the ubuntu version in cmake and install a separate logrotate file omitting the "su" lines. Can you do that instead please?

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 12, 2015

Updated by mfriedrich on 2015-05-12 07:57:55 +00:00

  • Relates set to 8190
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 29, 2016

Updated by gbeutner on 2016-03-29 12:59:59 +00:00

  • Target Version set to 2.4.5
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 29, 2016

Updated by purplecarrot on 2016-03-29 13:00:06 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 4970c45.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 20, 2016

Updated by gbeutner on 2016-04-20 08:15:49 +00:00

  • Backport? changed from Not yet backported to Already backported
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2016

Updated by mfriedrich on 2016-06-06 12:46:58 +00:00

  • Relates set to 11855
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.