Add radius server hostname to tickets

Alan DeKok aland at
Fri Apr 10 01:59:38 CEST 2009

Arran Cudbard-Bell wrote:
> A.L.M.Buxey at wrote:
>>>   Ok... this is something which should be addressed.  The simplest thing
>>> maybe to update the configuration parser to allow it to environment
>>> variables, e.g. $HOSTNAME, or something similar.
>> that'd be perfect.  +1 vote from me for that one.
> Second that. Would mean I could get rid of the branches in subversion
> and the raddb.local files.

  Hmm... I think this is one of those things I did a while ago, and then
forgot about.  "git" says that the code went in on March 1, 2001.  You
can refer to environment variables via $ENV{var}.

  i.e.  If you do this in radiusd.conf:

	$INCLUDE sites-enabled/$ENV{foo}

$ foo=default radiusd -X

  It will load the "default" virtual server.

$ foo=bar radiusd -X

  Will fail, because there's no virtual server named "bar".

  The only issue with this method is that there is no conditional
expansion.  i.e. If $ENV{foo} doesn't exist, there's no way to say "use
something else".

  So you could put the configurations for multiple machines into one
directory, and then have radiusd.conf do little more than:


  And it would read configuration files based on the host name, with no
other run-time changes.

  Alan DeKok.

More information about the Freeradius-Devel mailing list