sous-chefs/logrotate

Parameter 'create' does not appear to work

mlcooper opened this issue · 2 comments

This code below,

logrotate_app 'opscode-nginx' do
  path '/var/log/opscode-analytics/nginx/*.log'
  options %w(notifempty compress delaycompress copytruncate)
  frequency 'daily'
  rotate 21
  create '644 root root'
end

Does not appear to honor the create parameter:

 --- /etc/logrotate.d/opscode-nginx  2016-06-09 07:20:11.878360564 -0700
    +++ /tmp/chef-rendered-template20160609-21371-hsp3g3        2016-06-09 07:20:11.878360564 -0700
    @@ -1 +1,13 @@
    +# This file was generated by Chef for <redacted-server-name>.
    +# Do not modify this file by hand!
    +
    +"/var/log/opscode-analytics/nginx/*.log" {
    +  daily
    +  create 644 root root
    +  rotate 21
    +  notifempty
    +  compress
    +  delaycompress
    +  copytruncate
    +}
    - change mode from '' to '0440'
    - change owner from '' to 'root'
    - change group from '' to 'root'

Here is the file with 440 instead of 644:

[root@redacted logrotate.d]# ll ops*
-r--r----- 1 root root 247 Jun  9 07:20 opscode-nginx

I'm using v1.9.2 of this cookbook on RHEL6. Logrotate (yum package) info:

Arch        : x86_64
Version     : 3.7.8
Release     : 26.el6_7

@mlcooper I believe the 'create' directive instructs logrotate (the application) on the ownership of the created log files after rotation. The permissions you are checking are on the logrotate definition itself.

Ahh, I see what you mean there, thanks for the clarification.