Hi all, Can anyone please help me get the control socket for radmin working on Ubuntu. I've built FreeRADIUS v3.0.21 debs from source and install the debs on Ubuntu 18.04. I then created some ssl certs and the default config starts up ok. I then add a symlink to turn on the control-socket and sudo freeradius -X gives the error: Failed creating control socket "/var/run/freeradius/freeradius.sock": Failed creating control socket directory: Permission denied I know the service startup has comments about the directory creation not working on Ubuntu Bionic (18.04). So I've tried creating /usr/lib/tmpfiles.d/freeradius.conf containing: 'd /var/run/freeradius 0755 freerad freerad -' Ran sudo systemd-tmpfiles --create but no /var/run/freeradius Rebooted and no /var/run/freeradius sudo freeradius -X gives same error (as above). Anyone know how to get the control-socket to start correctly on Bionic? I've also tried on Ubuntu 16.04 and get the same issue, but I rather fix on 18.04 if poss. Many thanks all, Kev/.
On 26/04/2020 14:31, email.me@kevp.com wrote:
I then add a symlink to turn on the control-socket and sudo freeradius -X gives the error:
Which symlink? sites-enabled, or something else?
Failed creating control socket "/var/run/freeradius/freeradius.sock": Failed creating control socket directory: Permission denied
I know the service startup has comments about the directory creation not working on Ubuntu Bionic (18.04).
Yes, but the lines above it do work. Or at least they did.
So I've tried creating /usr/lib/tmpfiles.d/freeradius.conf containing: 'd /var/run/freeradius 0755 freerad freerad -'
Ran sudo systemd-tmpfiles --create but no /var/run/freeradius
That shouldn't be necessary.
Anyone know how to get the control-socket to start correctly on Bionic?
I'm pretty sure it was working, we went through a load of testing to get unit file settings that worked on multiple systems, hence the comments and (essentially) duplicated solution. Maybe Ubuntu changed something. -- Matthew
Thanks for the reply Matthew. You got me thinking... and I worked out what's happening. The runtime directory does get correctly created (and then freeradius starts correctly) when run as a service with: sudo systemctl start freeradius.service But if you stop the service and then run sudo freeradius -X you get the error because systemd isn't being invoked and doesn't create the directory. Creating the directory manually is a workaround but if you ever start and then stop the service with systemctl the directory is deleted on stop by default and sudo freeradius -X fails again. The workaround I'm going to use, so I can still use sudo freeradius -x for troubleshooting, is to add the following line to freeradius.service: RuntimeDirectoryPreserve=yes [ You also need to run this after this change to reload the service config: sudo systemctl daemon-reload ] This prevents the run directory from being deleted when the service is stopped. Given the service tries to start on boot, stopping it and then running sudo freeradius -X will then work. I'm not suggesting that the preserve line needs to be added to the source code but sudo freeradius -X won't work without this directory if the control socket is enabled on Ubuntu. Cheers Kev/. -----Original Message----- From: Freeradius-Users <freeradius-users-bounces+email.me=kevp.com@lists.freeradius.org> On Behalf Of Matthew Newton Sent: 26 April 2020 16:17 To: freeradius-users@lists.freeradius.org Subject: Re: Unable to create control socket On 26/04/2020 14:31, email.me@kevp.com wrote:
I then add a symlink to turn on the control-socket and sudo freeradius -X gives the error:
Which symlink? sites-enabled, or something else?
Failed creating control socket "/var/run/freeradius/freeradius.sock": Failed creating control socket directory: Permission denied
I know the service startup has comments about the directory creation not working on Ubuntu Bionic (18.04).
Yes, but the lines above it do work. Or at least they did.
So I've tried creating /usr/lib/tmpfiles.d/freeradius.conf containing: 'd /var/run/freeradius 0755 freerad freerad -'
Ran sudo systemd-tmpfiles --create but no /var/run/freeradius
That shouldn't be necessary.
Anyone know how to get the control-socket to start correctly on Bionic?
I'm pretty sure it was working, we went through a load of testing to get unit file settings that worked on multiple systems, hence the comments and (essentially) duplicated solution. Maybe Ubuntu changed something. -- Matthew - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Apr 26, 2020, at 9:31 AM, email.me@kevp.com wrote:
Can anyone please help me get the control socket for radmin working on Ubuntu.
I've built FreeRADIUS v3.0.21 debs from source and install the debs on Ubuntu 18.04.
I then created some ssl certs and the default config starts up ok.
That's good.
I then add a symlink to turn on the control-socket and sudo freeradius -X gives the error:
Failed creating control socket "/var/run/freeradius/freeradius.sock": Failed creating control socket directory: Permission denied
Are you running it as root? If so, you shouldn't get a permission denied error. if you're running it as "radiusd", ensure that the /var/run/freeradius/ directory exists, and is writeable by user "radiusd".
I know the service startup has comments about the directory creation not working on Ubuntu Bionic (18.04).
Where are this comments?
So I've tried creating /usr/lib/tmpfiles.d/freeradius.conf containing: 'd /var/run/freeradius 0755 freerad freerad -'
Ran sudo systemd-tmpfiles --create but no /var/run/freeradius
That seems an issue for systemd, then.
Rebooted and no /var/run/freeradius
Systemd typically deletes /var/run on every reboot.
sudo freeradius -X gives same error (as above).
Anyone know how to get the control-socket to start correctly on Bionic?
Create the directory with the correct permissions before you start FreeRADIUS. Or, start it as "root", but with uid/gid set in the configuration files. It should then create the directories itself, and set the right permissions. Alan DeKok.
participants (3)
-
Alan DeKok -
email.me@kevp.com -
Matthew Newton