voxpupuli/puppet-logrotate

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

Opened this issue · 5 comments

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.

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

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?

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

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

never mind, it works ok on centos7. sorry.