Centos7 FreeRadius 启动失败 Job for radiusd.service failed because the control process exited with error

使用radiusd -X 启动 可以看到启动过程及出错原因

配合查看日志/var/log/radius/radius.log 可以解决大部分内容

但radiusd -X可以启动 使用systemctl start radiusd.service启动却报错

[root@101-103 system]# systemctl start radiusd.service
Job for radiusd.service failed because the control process exited with error code. See "systemctl status radiusd.service" and "journalctl -xe" for details.
[root@101-103 system]# systemctl status radiusd.service
● radiusd.service - FreeRADIUS high performance RADIUS server.
   Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 四 2020-11-19 15:26:38 CST; 8s ago
  Process: 4505 ExecStart=/usr/sbin/radiusd -d /etc/raddb (code=exited, status=1/FAILURE)
  Process: 4500 ExecStartPre=/usr/sbin/radiusd -C (code=exited, status=0/SUCCESS)
  Process: 4498 ExecStartPre=/bin/chown -R radiusd.radiusd /var/run/radiusd (code=exited, status=0/SUCCESS)


日志内容:

Thu Nov 19 15:19:16 2020 : Info: rlm_sql_mysql: libmysql version: 5.5.60-MariaDB
Thu Nov 19 15:19:16 2020 : Info: rlm_sql (sql): Attempting to connect to database "radiusdb"
Thu Nov 19 15:19:16 2020 : Info: rlm_sql (sql): Opening additional connection (0), 1 of 32 pending slots used
Thu Nov 19 15:19:16 2020 : Error: rlm_sql_mysql: Couldn't connect to MySQL server dbuser@localhost:radiusdb
Thu Nov 19 15:19:16 2020 : Error: rlm_sql_mysql: MySQL error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
Thu Nov 19 15:19:16 2020 : Error: rlm_sql (sql): Opening connection failed (0)
Thu Nov 19 15:19:16 2020 : Error: /etc/raddb/mods-enabled/sql[20]: Instantiation failed for module "sql"

可以看到是找不到sock 我把sock创建了软链依旧不行

看到篇文章说 localhost 会走域套接字 使用IP地址却不会 于是改下配置文件:

vim /etc/raddb/mods-available/sql

把localhost改为127.0.0.1 成功

        # The dialect of SQL you want to use, this should usually match
        # the driver you selected above.
        #
        # If you're using rlm_sql_null, then it should be the type of
        # database the logged queries are going to be executed against.
        dialect = "mysql"

        # Connection info:
        #
        server = "127.0.0.1"

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值