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
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ class freeradius (

  # Syslog rules
  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',
  }

@@ -172,14 +172,14 @@ class freeradius (

  # Make the radius log dir traversable
  file { [
    '/var/log/radius',
    '/var/log/radius/radacct',
    $fr_logpath,
    "${fr_logpath}/radacct",
  ]:
    mode    => '0750',
    require => Package[$fr_package],
  }

  file { '/var/log/radius/radius.log':
  file { "${fr_logpath}/radius.log":
    owner   => 'radiusd',
    group   => 'radiusd',
    seltype => 'radiusd_log_t',
@@ -190,7 +190,7 @@ class freeradius (
    mode    => '0640',
    owner   => 'root',
    group   => 'radiusd',
    source  => 'puppet:///modules/freeradius/radiusd.logrotate',
    content => template('freeradius/radiusd.logrotate.erb'),
    require => Package[$fr_package],
  }

+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,13 @@ class freeradius::params {
    default  => '/etc/raddb',
  }

  # Path for FreeRADIUS logs
  $fr_logpath = $::osfamily ? {
    'RedHat' => '/var/log/radius',
    'Debian' => '/var/log/freeradius',
    default  => '/var/log/radius',
  }

  # FreeRADIUS user
  $fr_user = $::osfamily ? {
    'RedHat' => 'radiusd',
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ exec_prefix = /usr
sysconfdir = /etc
localstatedir = /var
sbindir = /usr/sbin
logdir = ${localstatedir}/log/radius
logdir = <%= @fr_logpath %>
raddbdir = ${sysconfdir}/raddb
radacctdir = ${logdir}/radacct

+7 −7
Original line number Diff line number Diff line
# 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

# There are different detail-rotating strategies you can use.  One is
@@ -8,7 +8,7 @@
# (or similar) in radiusd.conf, without rotation.  If you go with the
# 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.
/var/log/radius/radacct/*/*.log {
<%= @fr_logpath %>/radacct/*/*.log {
	daily
	rotate 7
	nocreate
@@ -16,7 +16,7 @@
	compress
}

/var/log/radius/checkrad.log {
<%= @fr_logpath %>/checkrad.log {
	weekly
	rotate 1
	create
@@ -24,7 +24,7 @@
	compress
}

/var/log/radius/radius*.log {
<%= @fr_logpath %>/radius*.log {
        weekly
        rotate 26
        create
@@ -32,7 +32,7 @@
        compress
}

/var/log/radius/radutmp {
<%= @fr_logpath %>/radutmp {
	weekly
	rotate 1
	create
@@ -40,14 +40,14 @@
	missingok
}

/var/log/radius/radwtmp {
<%= @fr_logpath %>/radwtmp {
	weekly
	rotate 1
	create
	compress
	missingok
}
/var/log/radius/sqltrace.sql {
<%= @fr_logpath %>/sqltrace.sql {
        weekly
        rotate 1
        create