大网数据广告活动
服务器运维问答

Adding compiled FreeRADIUS to systemd

· 52CE 我爱测

Working on getting FreeRADIUS up and running and having issues adding to systemd. Running standalone via radiusd -X works expected and all of the custom configurations are intact. Using freetds module to connect to MS SQL backend…

问题原文

原帖链接 · Arnydo · CC BY-SA 4.0

Working on getting FreeRADIUS up and running and having issues adding to systemd.

Running standalone via radiusd -X works expected and all of the custom configurations are intact. Using freetds module to connect to MS SQL backend...

During compilation I set it to use "--with-systemd" but it did not add a service entry automatically or create a *.service file that I can find.

I tried using one found online without success. This results in a timeout error.

[Unit]
Description=FreeRADIUS high performance RADIUS server.
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/radiusd/radiusd.pid
ExecStartPre=-/bin/chown -R freerad:freerad /var/run/radiusd
ExecStartPre=/usr/local/sbin/radiusd -C
ExecStart=/usr/local/sbin/radiusd -d /usr/local/etc/raddb
ExecReload=/usr/local/sbin/radiusd -C
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

Has anyone successfully added a compiled version of FreeRADIUS (3.0) to systemd? If so, can you give some guidance on how to get this working?

Thanks.

已采纳解答

原帖链接 · Anton Danilov · CC BY-SA 4.0

  1. The configure option "with-systemd" adds support of the systemd watch dog, but not includes the systemd unit file. If you don't sure, what you need it, don't enable this option.
  2. Try to diagnostize what happens. Start from systemctl status freeradius. What has it shown?
  3. Here is standard the systemd unit file from the freeradius package. Copy it into /etc/systemd/system/freeradius.service and change the pathes. It will the start point.
# /lib/systemd/system/freeradius.service
[Unit]
Description=FreeRADIUS multi-protocol policy server
After=network.target
Documentation=man:radiusd(8) man:radiusd.conf(5) http://wiki.freeradius.org/ http://networkradius.com/doc/

[Service]
Type=forking
PIDFile=/run/freeradius/freeradius.pid
EnvironmentFile=-/etc/default/freeradius
ExecStartPre=/usr/sbin/freeradius $FREERADIUS_OPTIONS -Cxm -lstdout
ExecStart=/usr/sbin/freeradius $FREERADIUS_OPTIONS
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Update from comments

  1. The systemd support in the freeradius includes some features:

    • Notification about completion of start-up
    • The systemd watchdog support to prevent the hunging up.
  2. The best aproach is:

    • Use this hardened service unit for freeradius. Change the pathes to yours.
    • Pass the -f option to the freeradius to prevent forking. If you use the service unit flle from link above, you should add -f into /etc/sysconfig/radiusd. Some discussion about it you can read here. The forking is the legacy way to deamonize. Today a demonization at start of program can be delegate to special programs like systemd or start-stop-daemon.
    • Use Type=notify in the service section of the unit file.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-06-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。