启动 – Centos 7.由于优先级,Freeradius无法启动

前端之家收集整理的这篇文章主要介绍了启动 – Centos 7.由于优先级,Freeradius无法启动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在搞乱FreeRADIUS和 MySQL(MariaDB),似乎FreeRADIUS服务无法在启动时正常启动.但它使用root用户或在调试模式(radiusd -X)开始正常,并且工作得很好!调试模式显示没有错误.

systemctl命令显示radiusd.service无法启动.

/ var / log / messages输出

Aug 21 15:52:29 nexus-test systemd: Starting The Apache HTTP Server...
Aug 21 15:52:29 nexus-test systemd: Starting MariaDB database server...
Aug 21 15:52:29 nexus-test systemd: Starting FreeRADIUS high performance RADIUS server....
Aug 21 15:52:29 nexus-test systemd: Started OpenSSH server daemon.
Aug 21 15:52:29 nexus-test MysqLd_safe: 140821 15:52:29 MysqLd_safe Logging to '/var/log/mariadb/mariadb.log'.
Aug 21 15:52:29 nexus-test MysqLd_safe: 140821 15:52:29 MysqLd_safe Starting MysqLd daemon with databases from /var/lib/MysqL
Aug 21 15:52:30 nexus-test systemd: Started Postfix Mail Transport Agent.
Aug 21 15:52:30 nexus-test avahi-daemon[604]: Registering new address record for fe80::250:56ff:fe85:e4af on eth0.*.
Aug 21 15:52:30 nexus-test systemd: radiusd.service: control process exited,code=exited status=1
Aug 21 15:52:30 nexus-test systemd: Failed to start FreeRADIUS high performance RADIUS server..
Aug 21 15:52:30 nexus-test systemd: Unit radiusd.service entered Failed state.
Aug 21 15:52:31 nexus-test kdumpctl: kexec: loaded kdump kernel
Aug 21 15:52:31 nexus-test kdumpctl: Starting kdump: [OK]
Aug 21 15:52:31 nexus-test systemd: Started Crash recovery kernel arming.
Aug 21 15:52:31 nexus-test systemd: Started The Apache HTTP Server.
Aug 21 15:52:31 nexus-test systemd: Started MariaDB database server.

/var/log/radius/radius.log输出

Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): Driver rlm_sql_MysqL (module rlm_sql_MysqL) loaded and linked
Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): Attempting to connect to database "radius"
Thu Aug 21 15:24:16 2014 : Info: rlm_sql (sql): opening additional connection (0)
Thu Aug 21 15:24:16 2014 : Error: rlm_sql_MysqL: Couldn't connect socket to MysqL server radius@localhost:radius
Thu Aug 21 15:24:16 2014 : Error: rlm_sql_MysqL: MysqL error 'Can't connect to local MysqL server through socket '/var/lib/MysqL/MysqL.sock' (2)'
Thu Aug 21 15:24:16 2014 : Error: rlm_sql (sql): opening connection Failed (0)
Thu Aug 21 15:24:16 2014 : Error: /etc/raddb/mods-enabled/sql[47]: Instantiation Failed for module "sql"

看到这个之后我试图复制问题,杀了mariadb.service并开始再次运行调试模式.它会吐出与radius.log相同的问题.

我试过禁用iptables和firewalld并重新启动,但没有运气:

systemctl disable iptables
systemctl disable firewalld

所以问题可能在于流程启动顺序或某种延迟.也许FreeRADIUS的sql模块无法连接到尚未启动的MariaDB?如果它,我该如何解决这个问题?

在早期版本的RHEL / CENTOS中,我知道你很容易看到服务启动顺序,如rc.d或stuff,现在IDK.我是这个花哨的“systemd”,“systemctl”,“firewalld”的新手Centos 7介绍所以对不起我有点困惑.这个新的FreeRADIUS 3结构……

PS. MariaDB在启动时启用,FR DB配置中的凭据是正确的

一点点更新:

cat /etc/systemd/system/multi-user.target.wants/radiusd.service输出

[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 radiusd.radiusd /var/run/radiusd
ExecStartPre=/usr/sbin/radiusd -C
ExecStart=/usr/sbin/radiusd -d /etc/raddb
ExecReload=/usr/sbin/radiusd -C
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
谢谢你,dawud,你把我推向了正确的方向.我在这里要做的是make radiusd.service start maTERadb.service.

我在/etc/systemd/system/multi-user.target.wants/radiusd.service上启动了vim并在[Unit]部分添加了一行:

After=mariadb.service

所以它看起来像这样:

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

重启后,FreeRADIUS启动就好了.

this resource也帮助了我一点点.

原文链接:https://www.f2er.com/centos/373669.html

猜你在找的CentOS相关文章