From 09084c977e15befe3baad533e09054b5f62c2041 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Fri, 14 Oct 2011 16:14:43 +0300 Subject: [PATCH] Added syslog's all.log rotation for OpenBSD --- syslog/manifests/init.pp | 13 +++++++++++++ syslog/templates/logrotate.erb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/syslog/manifests/init.pp b/syslog/manifests/init.pp index bf6e1ff..3e1d747 100644 --- a/syslog/manifests/init.pp +++ b/syslog/manifests/init.pp @@ -46,6 +46,13 @@ class syslog::common { content => template("syslog/logrotate.erb"), } } + "openbsd": { + exec { "add-newsyslog-all": + path => "/bin:/usr/bin:/sbin:/usr/sbin", + command => "echo '/var/log/all.log root:${group} 640 7 * \$D0 Z' >> /etc/newsyslog.conf", + unless => "grep -q '^/var/log/all.log' /etc/newsyslog.conf", + } + } } } @@ -211,6 +218,12 @@ class syslog::common::standalone inherits syslog::common { ensure => absent, } } + "openbsd": { + Exec["add-newsyslog-all"] { + # never run this + unless => "true", + } + } } file { "/usr/local/sbin/logarchiver.sh": diff --git a/syslog/templates/logrotate.erb b/syslog/templates/logrotate.erb index ed2c682..ef586f0 100644 --- a/syslog/templates/logrotate.erb +++ b/syslog/templates/logrotate.erb @@ -1,5 +1,5 @@ /var/log/all.log { - create 0640 root <%= syslog_group %> + create 0640 root <%= 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