Added syslog's all.log rotation for Linux
This commit is contained in:
parent
592c53a546
commit
6f17fb9013
2 changed files with 27 additions and 0 deletions
|
@ -36,6 +36,18 @@ class syslog::common {
|
|||
}
|
||||
}
|
||||
|
||||
case $kernel {
|
||||
"linux": {
|
||||
file { "/etc/logrotate.d/syslog.all":
|
||||
ensure => present,
|
||||
mode => 0644,
|
||||
owner => "root",
|
||||
group => "root",
|
||||
content => template("syslog/logrotate.erb"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Install syslog client
|
||||
|
@ -193,6 +205,14 @@ class syslog::common::standalone inherits syslog::common {
|
|||
target => "/srv/log/all.log",
|
||||
}
|
||||
|
||||
case $kernel {
|
||||
"linux": {
|
||||
File["/etc/logrotate.d/syslog.all"] {
|
||||
ensure => absent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file { "/usr/local/sbin/logarchiver.sh":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/syslog/logarchiver.sh",
|
||||
|
|
7
syslog/templates/logrotate.erb
Normal file
7
syslog/templates/logrotate.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
/var/log/all.log {
|
||||
create 0640 root <%= syslog_group %>
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
Loading…
Add table
Reference in a new issue