freeradius exec module only works in debug mode (freeradius -X)

Alan DeKok aland at deployingradius.com
Mon Aug 14 14:48:25 UTC 2023


On Aug 14, 2023, at 10:41 AM, Härtl, Calvin <Calvin.Haertl at stud.hs-coburg.de> wrote:
> However, as soon as I exit the debug mode and run freeradius as a daemon (systemctl start freeradius), freeradius still works as expected, but the mail no longer gets sent out.
> Everything else works just fine (users can hop onto the WiFi, etc.).
> 
> Am I missing something here? Any help is appreciated!

  FreeRADIUS itself doesn't care about debug mode vs daemon mode, user IDs etc.  It just does what you want.

  The problem here is likely that in daemon mode, the server is running with a different ID (freerad or something similar).  And that user doesn't have permission to run the tools.

  The solution is to go through radiusd.conf to check the "user = " and "group = " configuration.  Then, become root, and then "su" to the freerad user / group.

  Try to run the script as that user.  If it doesn't work, then you know what the problem is, and you can debug it as user "freerad".

  It it does work, then the problem is something else, like paths.

  One simple thing is to put full paths to all executables into the "exec" line.  i.e. instead of:

	echo ... | mailx ...

  do

	/bin/echo ... | /usr/bin/mailx ...

  Or whatever paths are correct for your system.

  Check also the documentation for the "mailx" command.  Some mailers refuse to run for certain users.  You may need to update the mail configuration to allow sending mail as the "freerad" user.

  Alan DeKok.



More information about the Freeradius-Users mailing list