summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-11-23 10:32:50 -0200
committerSilvio Rhatto <rhatto@riseup.net>2014-11-23 10:32:50 -0200
commited99503fb1b426ad73c4c20b90cf0fe3d98f0bf2 (patch)
treec2fbc89021659121a84d173bb04789decd61d2a1
parentbfbec3f3f9563989b003495cd553c8afa1a1b980 (diff)
downloadpuppet-apache-ed99503fb1b426ad73c4c20b90cf0fe3d98f0bf2.tar.gz
puppet-apache-ed99503fb1b426ad73c4c20b90cf0fe3d98f0bf2.tar.bz2
Avoid logrotate errors inside vservers
-rw-r--r--files/logrotate2
-rw-r--r--manifests/init.pp13
2 files changed, 14 insertions, 1 deletions
diff --git a/files/logrotate b/files/logrotate
index 73cc252..7c71488 100644
--- a/files/logrotate
+++ b/files/logrotate
@@ -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 \
diff --git a/manifests/init.pp b/manifests/init.pp
index cbdd051..5796fe0 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -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,
+ },
+ }
}