Control socket directory doesn't exist after systemd stopping service

Nick Porter nick at portercomputing.co.uk
Wed Nov 30 11:18:34 UTC 2022


On 30/11/2022 03:29, Matthew McTague via Freeradius-Users wrote:
> Correcting the previous command I sent:
>
> mkdir -p /var/run/radiusd && chown radiusd:radiusd /var/run/radiusd && chmod 750 /var/run/radiusd && radiusd -X
>
> Warm Regards,


An alternative (depending on the version of systemd - Rocky is fine for 
this) is to add a systemd override

Create /etc/systemd/system/radiusd.service.d/override.conf with contents 
like

[Service]
User=radiusd
Group=radiusd
RuntimeDirectory=radiusd
RuntimeDirectoryPreserve=yes
RuntimeDirectoryMode=0770

That will ensure that /var/run/radiusd is created by systemd when the 
radiusd service is started, but it won't be deleted when the service stops.

If you put your control socket in a subdirectory of /var/run/radiusd 
then you can add that directory to the RuntimeDirectory line e.g.

RuntimeDirectory=radiusd radiusd/control

will create both /var/run/radiusd and /var/run/radiusd/control.

On Debian / Ubuntu machines the names change - the service is freeradius 
and the user / group are freerad.

Older RHEL family systems are more of a pain as they don't have the 
RuntimeDirectoryPreserve option which is key to this working.

Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20221130/a06affd6/attachment.sig>


More information about the Freeradius-Users mailing list