Skip to content
Snippets Groups Projects
Commit 9a4925cf authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Add support for log directory being in different locations on Red Hat

and Debian
parent a935dc67
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,7 @@ class freeradius ( ...@@ -158,7 +158,7 @@ class freeradius (
# Syslog rules # Syslog rules
syslog::rule { 'radiusd-log': syslog::rule { 'radiusd-log':
command => "if \$programname == \'radiusd\' then /var/log/radius/radius.log\n&~", command => "if \$programname == \'radiusd\' then ${fr_logpath}/radius.log\n&~",
order => '12', order => '12',
} }
...@@ -172,14 +172,14 @@ class freeradius ( ...@@ -172,14 +172,14 @@ class freeradius (
# Make the radius log dir traversable # Make the radius log dir traversable
file { [ file { [
'/var/log/radius', $fr_logpath,
'/var/log/radius/radacct', "${fr_logpath}/radacct",
]: ]:
mode => '0750', mode => '0750',
require => Package[$fr_package], require => Package[$fr_package],
} }
file { '/var/log/radius/radius.log': file { "${fr_logpath}/radius.log":
owner => 'radiusd', owner => 'radiusd',
group => 'radiusd', group => 'radiusd',
seltype => 'radiusd_log_t', seltype => 'radiusd_log_t',
...@@ -190,7 +190,7 @@ class freeradius ( ...@@ -190,7 +190,7 @@ class freeradius (
mode => '0640', mode => '0640',
owner => 'root', owner => 'root',
group => 'radiusd', group => 'radiusd',
source => 'puppet:///modules/freeradius/radiusd.logrotate', content => template('freeradius/radiusd.logrotate.erb'),
require => Package[$fr_package], require => Package[$fr_package],
} }
......
...@@ -29,6 +29,13 @@ class freeradius::params { ...@@ -29,6 +29,13 @@ class freeradius::params {
default => '/etc/raddb', default => '/etc/raddb',
} }
# Path for FreeRADIUS logs
$fr_logpath = $::osfamily ? {
'RedHat' => '/var/log/radius',
'Debian' => '/var/log/freeradius',
default => '/var/log/radius',
}
# FreeRADIUS user # FreeRADIUS user
$fr_user = $::osfamily ? { $fr_user = $::osfamily ? {
'RedHat' => 'radiusd', 'RedHat' => 'radiusd',
......
...@@ -62,7 +62,7 @@ exec_prefix = /usr ...@@ -62,7 +62,7 @@ exec_prefix = /usr
sysconfdir = /etc sysconfdir = /etc
localstatedir = /var localstatedir = /var
sbindir = /usr/sbin sbindir = /usr/sbin
logdir = ${localstatedir}/log/radius logdir = <%= @fr_logpath %>
raddbdir = ${sysconfdir}/raddb raddbdir = ${sysconfdir}/raddb
radacctdir = ${logdir}/radacct radacctdir = ${logdir}/radacct
......
# You can use this to rotate the /var/log/radius/* files, simply copy # You can use this to rotate the <%= @fr_logpath %>/* files, simply copy
# it to /etc/logrotate.d/radiusd # it to /etc/logrotate.d/radiusd
# There are different detail-rotating strategies you can use. One is # There are different detail-rotating strategies you can use. One is
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# (or similar) in radiusd.conf, without rotation. If you go with the # (or similar) in radiusd.conf, without rotation. If you go with the
# second technique, you will need another cron job that removes old # second technique, you will need another cron job that removes old
# detail files. You do not need to comment out the below for method #2. # detail files. You do not need to comment out the below for method #2.
/var/log/radius/radacct/*/*.log { <%= @fr_logpath %>/radacct/*/*.log {
daily daily
rotate 7 rotate 7
nocreate nocreate
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
compress compress
} }
/var/log/radius/checkrad.log { <%= @fr_logpath %>/checkrad.log {
weekly weekly
rotate 1 rotate 1
create create
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
compress compress
} }
/var/log/radius/radius*.log { <%= @fr_logpath %>/radius*.log {
weekly weekly
rotate 26 rotate 26
create create
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
compress compress
} }
/var/log/radius/radutmp { <%= @fr_logpath %>/radutmp {
weekly weekly
rotate 1 rotate 1
create create
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
missingok missingok
} }
/var/log/radius/radwtmp { <%= @fr_logpath %>/radwtmp {
weekly weekly
rotate 1 rotate 1
create create
compress compress
missingok missingok
} }
/var/log/radius/sqltrace.sql { <%= @fr_logpath %>/sqltrace.sql {
weekly weekly
rotate 1 rotate 1
create create
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment