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

logrotate btmp.conf/wtmp.conf files contains su directives, but logrotate on CentOS-6 does not support them #81

Open
storm49152 opened this issue Oct 27, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@storm49152
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10
  • Ruby: 1.8.7
  • Distribution: CentOS-6
  • Module version: 3.0.1
  • logrotate version: # rpm -q logrotate
    logrotate-3.7.8-28.el6.x86_64

How to reproduce (e.g Puppet code you use)

  logrotate::rule { 'some_log_file':
    ensure        => present,
    path          => '/var/log/some_log_file.log',
    missingok     => true,
    ifempty       => false,
    compress      => true,
    rotate_every  => 'day',
    rotate        => 8,
  }

There is nu su, su_owner or su_group defined. Looking at the code, this will then default to 'root' and 'root'. It's not actually about the file that this creates, but the btmp and wtmp files.

What are you seeing

The logrotate module will alter /etc/logrotate.conf, and place new btmp and wtmp files. The btmp and wtmp files look like:

# cat btmp 
# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.  ANY CHANGES WILL BE
# OVERWRITTEN.

/var/log/btmp {
  compress
  create 0600 root utmp
  dateext
  minsize 1M
  missingok
  monthly
  rotate 1
  sharedscripts
  su root root
}

# cat wtmp  
# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.  ANY CHANGES WILL BE
# OVERWRITTEN.

/var/log/wtmp {
  compress
  create 0664 root utmp
  dateext
  minsize 1M
  monthly
  nomissingok
  rotate 1
  sharedscripts
  su root root
}

This is fine, except for the su directive, because CentOS-6's logrotate does not support the 'su' directive.

What behaviour did you expect instead

The files should not have the su directive.

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Dec 6, 2017
@Heidistein
Copy link

I have no way of testing this. But this -might- be fixed with PR #128

@storm49152
Copy link
Author

I would be happy to test this. Is there anything I can download to try it, or do I simply wait for a new release?

@Heidistein
Copy link

You could git checkout (or download the zip) from the latest master, and load that into your test env...
https:/voxpupuli/puppet-logrotate/archive/master.zip

@billjamzz
Copy link

looks like was deleted for all RedHat but centos 7 still needs it. can it be only removed for centos6?

@billjamzz
Copy link

never mind, it works ok on centos7. sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants