Freeradius (radiusd) 服务无法开机启动,但可以手动启动

Freeradius (radiusd) 服务无法开机启动,但可以手动启动

我设法使用编译源在 Centos 7 上设置 freeradius 服务器ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.18.tar.gz

一切都工作得很好,除了服务不能每次重新启动后运行。我必须发出命令...

sudo systemctl start radiusd

服务运行成功。以下是日志

● radiusd.service - FreeRADIUS config by ME.
  Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
  Active: active (running) since Sat 2022-01-22 00:10:50 +08; 7s ago
  Process: 2036 ExecStart=/opt/freeradius/sbin/radiusd -d /opt/freeradius/etc/raddb (code=exited, status=0/SUCCESS)
  Process: 2028 ExecStartPre=/opt/freeradius/sbin/radiusd (code=exited, status=0/SUCCESS)
  Process: 2023 ExecStartPre=/opt/freeradius/sbin/radiusd -C (code=exited, status=0/SUCCESS)
  Process: 2020 ExecStartPre=/bin/chown -R radiusd.radiusd /var/run/radiusd (code=exited, status=0/SUCCESS)
  Main PID: 2039 (radiusd)
  CGroup: /system.slice/radiusd.service
       └─2039 /opt/freeradius/sbin/radiusd -d /opt/freeradius/etc/raddb

这是我的 radiusd.service 的 systemd 内容

[Unit]
 Description=FreeRADIUS config by ME.
 After=syslog.target network.target ipa.service dirsrv.target krb5kdc.service smb.service nmb.service

[Service]
 Type=forking
 #PIDFile=/var/run/radiusd/radiusd.pid

 ExecStartPre=-/bin/chown -R radiusd.radiusd /var/run/radiusd
 ExecStartPre=/opt/freeradius/sbin/radiusd -C
 ExecStart=/opt/freeradius/sbin/radiusd -d /opt/freeradius/etc/raddb
 ExecReload=/opt/freeradius/sbin/radiusd
 ExecReload=/bin/kill -HUP $MAINPID

[Install]
 WantedBy=multi-user.target

这是重启后的系统日志

● radiusd.service - FreeRADIUS config by ME.
  Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since Sat 2022-01-22 00:32:31 +08; 48s ago
  Process: 1320 ExecStartPre=/opt/freeradius/sbin/radiusd -C (code=exited, status=1/FAILURE)
  Process: 1284 ExecStartPre=/bin/chown -R radiusd.radiusd /var/run/radiusd (code=exited, status=0/SUCCESS)

 Jan 22 00:32:22 myhost systemd[1]: Starting FreeRADIUS config by ME....
 Jan 22 00:32:31 myhost systemd[1]: radiusd.service: control process exited, code=exited status=1
 Jan 22 00:32:31 myhost systemd[1]: Failed to start FreeRADIUS config by ME..
 Jan 22 00:32:31 myhost systemd[1]: Unit radiusd.service entered failed state.
 Jan 22 00:32:31 myhost systemd[1]: radiusd.service failed.

我只是不知道还能去哪里查看,因为这是我找到的唯一日志。

答案1

从手册页...

The server can return a zero status code when run with -C, but may still exit with an error when run normally.

我想我会摆脱ExecStartPre=/opt/freeradius/sbin/radiusd -C

如果您没有进行任何更改,那么运行检查似乎没有意义。

相关内容