From f7298b567117616ecede5c2eb1c3e5c53b65c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Wed, 6 Feb 2013 09:23:27 +0200 Subject: [PATCH] Fixed SELinux context from apache logrotate script in Fedora. --- apache/manifests/init.pp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apache/manifests/init.pp b/apache/manifests/init.pp index 7a6ec23..d525281 100644 --- a/apache/manifests/init.pp +++ b/apache/manifests/init.pp @@ -81,9 +81,16 @@ class apache::common { group => "root", seltype => "httpd_rotatelogs_exec_t", } - selinux::manage_fcontext { "/usr/local/sbin/www-logrotate.sh": - type => "httpd_rotatelogs_exec_t", - before => File["/usr/local/sbin/www-logrotate.sh"], + if $::operatingsystem == "Fedora" and $::operatingsystemrelease > 17 { + selinux::manage_fcontext { "/usr/sbin/www-logrotate.sh": + type => "httpd_rotatelogs_exec_t", + before => File["/usr/local/sbin/www-logrotate.sh"], + } + } else { + selinux::manage_fcontext { "/usr/local/sbin/www-logrotate.sh": + type => "httpd_rotatelogs_exec_t", + before => File["/usr/local/sbin/www-logrotate.sh"], + } } cron { "www-logrotate":