I've changed the example.pl perl script so it 'use DBI;' to query a Sybase server via freetds. <br>It works fine when running in foreground "radiusd -X" while testing.<br>However, if ran in background, the perl script gets triggered, but the dbi connect fails:<br>
<br>my $dbh = DBI->connect("dbi:Sybase:server=*****", $user, $passwd, {PrintError => 0});<br><div id=":tr" class="ArwC7c ckChnd"><br>Error: rlm_perl: perl_embed:: module = /etc/raddb/<a href="http://myperlscript.pm/" target="_blank">myperlscript.pm</a>
, func = authenticate exit status= Unable for connect to server
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER =
(41) Server ******, database Message String: Server is unavailable or
does not exist.<br>
<br>* Tethereal shows that there is no network activity towards the Sybase server.<br>*
At first I guessed using user radiusd instead of root would sabotage
access to /etc/freetds.conf and/or freetds libraries, but changing
radiusd.conf so it keep root priviledges didn't help.<br>
* I've been checking environment parameters between foreground and background, but could not find a discriminator.<br>*
Assuming some chroot'ing getting done by radiusd I have moved
freetds.conf inside /etc/raddb ( and /etc/raddb/etc ) to no avail.<br>
* I have ran strace -f -p <pid> in the hope to see what the
perlscript tries to do when invoked by a radius request, but I only see
it writing the error to the /var/log/radius/radius.log<br>* Changed the hostname towards ip address in /etc/freetds.conf to avoid a failing name resolving.<br>
<br>Any hints welcome for solution or better tools to debug/strace into the perl script.</div>