问题原文
原帖链接 · 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
- 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.
- Try to diagnostize what happens. Start from
systemctl status freeradius. What has it shown? - Here is standard the systemd unit file from the freeradius package. Copy it into
/etc/systemd/system/freeradius.serviceand 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
The systemd support in the freeradius includes some features:
- Notification about completion of start-up
- The systemd watchdog support to prevent the hunging up.
The best aproach is:
- Use this hardened service unit for freeradius. Change the pathes to yours.
- Pass the
-foption to the freeradius to prevent forking. If you use the service unit flle from link above, you should add-finto/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=notifyin the service section of the unit file.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
