diff --git a/INSTALL b/INSTALL index e51237344c20f81f009c207c68a2fe48a23d3d02..e8cbdc531f83b0785da63acf28fbd9fc50040ba3 100644 --- a/INSTALL +++ b/INSTALL @@ -19,3 +19,13 @@ Installing SMRadius. + +1. Setup system dirs + +mkdir /var/log/smradius +mkdir /var/run/smradius + +If you are running smradius as an unpriv user, then ... +chown smradius.smradius /var/log/smradius /var/run/smradius + + diff --git a/UPGRADING b/UPGRADING index e0e12693a1b0fe9d7c63a2e212befb2010d9c2d6..79eefe1b16dfe842f927c7756594cd0754eee5be 100644 --- a/UPGRADING +++ b/UPGRADING @@ -2,6 +2,13 @@ 2011-01-11: Move configuration file item "use_packet_timestamp=" to "[radius]" section + mkdir /var/log/smradius + mkdir /var/run/smradius + + If you are running smradius as an unpriv user, then ... + chown smradius.smradius /var/log/smradius /var/run/smradius + + --- r574: diff --git a/smradiusd b/smradiusd index 2362c4a247c54058fa7fdb246c437d30ee98f454..182904ae8ac139e97f0802e1888d0f10379b0292 100755 --- a/smradiusd +++ b/smradiusd @@ -68,12 +68,13 @@ sub configure { # Set defaults my $cfg; $cfg->{'config_file'} = "/etc/smradiusd.conf"; + $cfg->{'cache_file'} = '/var/run/smradius/cache'; $server->{'timeout'} = 120; $server->{'background'} = "yes"; - $server->{'pid_file'} = "/var/run/smradiusd.pid"; + $server->{'pid_file'} = "/var/run/smradius/smradiusd.pid"; $server->{'log_level'} = 2; - $server->{'log_file'} = "/var/log/smradiusd.log"; + $server->{'log_file'} = "/var/log/smradius/smradiusd.log"; $server->{'host'} = "*"; $server->{'port'} = [ 1812, 1813 ]; @@ -293,6 +294,12 @@ sub configure { } } + # Check if the user specified a cache_file in the config + if (defined($config{'server'}{'cache_file'})) { + $cfg->{'cache_file'} = $config{'server'}{'cache_file'}; + } + + # Save our config and stuff $self->{'config'} = $cfg; $self->{'cmdline'} = $cmdline; @@ -348,7 +355,12 @@ sub post_configure_hook { $self->log(LOG_INFO,"[SMRADIUS] Initializing system modules."); # Init caching engine - awitpt::cache::Init($self); + awitpt::cache::Init($self,{ + 'cache_file' => $self->{'config'}{'cache_file'}, + 'cache_file_user' => $self->{'server'}->{'user'}, + 'cache_file_group' => $self->{'server'}->{'group'} + }); + $self->log(LOG_INFO,"[SMRADIUS] System modules initialized."); } diff --git a/smradiusd.conf b/smradiusd.conf index 6c816e5436a8ad74c344a6dbbb6dc5796b1e0bc1..e84c263e7485ffcb75600617d857b0244fa86dd6 100644 --- a/smradiusd.conf +++ b/smradiusd.conf @@ -8,7 +8,11 @@ #group= # Filename to store pid of parent process -#pid_file=/var/run/smradiusd.pid +#pid_file=/var/run/smradius/smradiusd.pid + +# Cache file +#cache_file=/var/run/smradius/cache + # Uncommenting the below option will prevent awradiusd going into the background #background=no