$ENV{HOSTNAME} on debian hosts

Fred fred.maison at gmail.com
Thu Sep 29 10:40:39 CEST 2011


Hi all,

I want to advise everyone of a debian-specific problem using
$ENV{HOSTNAME} in freeradius 2 config files :

It seems environment passed to freeradius at startup does not have
HOSTNAME defined.
In fact, it seems only a subset of environment variables are passed to
executables ...

To be able to use this, we have to explicitly set HOSTNAME environment
BEFORE launching freeradius.

For example :
freeradius -X  will expand $ENV{HOSTNAME} to empty string

HOSTNAME=`hostname` freeradius -X will expand $ENV{HOSTNAME} to
correct value ...

in /etc/freeeradois/init.d, you could use this :

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" ### this is present in original
export HOSTNAME="`hostname`" ### this has to be added to access $ENV{HOSTNAME}

Please note : other debian base distro as Ubuntu show same issue.


Best regards
Fred



More information about the Freeradius-Users mailing list