]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Avoid logrotate errors inside vservers
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Nov 2014 12:32:50 +0000 (10:32 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 23 Nov 2014 12:32:50 +0000 (10:32 -0200)
files/logrotate
manifests/init.pp

index 73cc252337d67d73cd593587b9159b29970b3c94..7c71488688fd4b0f58ef6ee73afca001d067eb3b 100644 (file)
@@ -8,7 +8,7 @@
        create 640 root adm
        sharedscripts
        postrotate
-               /etc/init.d/apache2 reload > /dev/null
+               /etc/init.d/apache2 reload &> /dev/null
        endscript
        prerotate
                if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
index cbdd051aec9dcc0ef373c3d32f941b3c30599c2f..5796fe042505e2dbc084db8c905325b22e68574d 100644 (file)
@@ -204,4 +204,17 @@ class apache(
     command     => "/etc/init.d/apache2 force-reload",
     refreshonly => true,
   }
+
+  # Avoid this logrotate error:
+  # /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
+  file { '/etc/logrotate.d/apache2':
+    ensure => present,
+    owner  => root,
+    group  => root,
+    mode   => 0644,
+    source => $::virtual ? {
+      'vserver' => 'puppet:///modules/apache/logrotate',
+      default   => undef,
+    },
+  }
 }