freeradius启动错误(代码=退出,状态= 1 / FAILURE)

时间:2017-03-01 21:33:51

标签: centos mariadb freeradius

我是freeradius的新手。我在centos-7上安装了freeradius,并计划使用daloradius进行管理。 安装freeradius之后它工作正常,通常由“systemctl start radiusd”启动。 但在安装和配置MariaDB之后,使用“radiusd -X”工作时freeradius无法启动。 以下是错误消息:

CREATE OR REPLACE FUNCTION consolidate_user_bandwidths(
  IN _tbl REGCLASS,
  IN _savetime TIMESTAMP
  ) RETURNS void AS
  $BODY$
    BEGIN
      EXECUTE 'CREATE TEMP TABLE user_bandwidths_temp ON COMMIT DROP AS 
            SELECT MAX(id) AS id, SUM(bandwidth_in) AS bandwidth_in, 
                   SUM(bandwidth_out) AS bandwidth_out,
                   '''|| _savetime ||'''::timestamp AS created_at, 
                   SUM(bandwidth_total) AS bandwidth_total, name,                             
                   device_type, device_os,
                   ownership, host_name  
            FROM '|| _tbl ||' 
            GROUP BY name, device_type,
                     device_os, ownership, host_name';
      EXECUTE 'TRUNCATE TABLE '|| _tbl ||'';
      EXECUTE 'INSERT INTO '|| _tbl ||' SELECT * FROM user_bandwidths_temp';
    END;
  $BODY$
  LANGUAGE 'plpgsql' VOLATILE;

请帮我解决这个问题。 任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:2)

这可能是权限问题。 -X以当前用户身份运行流程,而-C将更改为已配置的用户/组。

您可以使用此调用来执行配置检查,并将调试信息写入stdout。

/usr/sbin/radiusd -C -lstdout -xxx
  • -C配置检查
  • -lstdout覆盖已配置的记录目标并设置为stdout。
  • -xxx将调试设置为3级。应显示任何有用的输出。

如果对您没有意义,请向我们报告输出,并且我会解释。

答案 1 :(得分:0)

我匹配同样的问题,经过Arran的命令检查后会让你知道原因,但建议你通过" radius -X"在root环境下,这会给你根本原因,如我的问题:

在用户环境下:

[cisco@frank ~]$ /usr/sbin/radiusd -C -lstdout -xxx
Wed May 17 04:47:36 2017 : Info: radiusd: FreeRADIUS Version 3.0.1, for host x86_64-redhat-linux-gnu, built on Mar  5 2014 at 05:31:12
Wed May 17 04:47:36 2017 : Debug: Server was built with: 
Wed May 17 04:47:36 2017 : Debug:   accounting
Wed May 17 04:47:36 2017 : Debug:   authentication
Wed May 17 04:47:36 2017 : Debug:   ascend binary attributes
Wed May 17 04:47:36 2017 : Debug:   coa
Wed May 17 04:47:36 2017 : Debug:   control-socket
Wed May 17 04:47:36 2017 : Debug:   detail
Wed May 17 04:47:36 2017 : Debug:   dhcp
Wed May 17 04:47:36 2017 : Debug:   dynamic clients
Wed May 17 04:47:36 2017 : Debug:   proxy
Wed May 17 04:47:36 2017 : Debug:   regex-pcre
Wed May 17 04:47:36 2017 : Debug:   session-management
Wed May 17 04:47:36 2017 : Debug:   stats
Wed May 17 04:47:36 2017 : Debug:   tcp
Wed May 17 04:47:36 2017 : Debug:   threads
Wed May 17 04:47:36 2017 : Debug:   tls
Wed May 17 04:47:36 2017 : Debug:   unlang
Wed May 17 04:47:36 2017 : Debug:   vmps
Wed May 17 04:47:36 2017 : Debug: Server core libs:
Wed May 17 04:47:36 2017 : Debug:   talloc : 2.0.*
Wed May 17 04:47:36 2017 : Debug:   ssl    : OpenSSL 1.0.1e-fips 11 Feb 2013
Wed May 17 04:47:36 2017 : Info: Copyright (C) 1999-2014 The FreeRADIUS server project and contributors
Wed May 17 04:47:36 2017 : Info: There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Wed May 17 04:47:36 2017 : Info: PARTICULAR PURPOSE
Wed May 17 04:47:36 2017 : Info: You may redistribute copies of FreeRADIUS under the terms of the
Wed May 17 04:47:36 2017 : Info: GNU General Public License
Wed May 17 04:47:36 2017 : Info: For more information about these matters, see the file named COPYRIGHT
Wed May 17 04:47:36 2017 : Info: Starting - reading configuration files ...
Wed May 17 04:47:36 2017 : Debug: including dictionary file /etc/raddb/dictionary
Wed May 17 04:47:36 2017 : Debug: including configuration file /etc/raddb/radiusd.conf
Wed May 17 04:47:36 2017 : Error: Unable to open file "/etc/raddb/radiusd.conf": Permission denied
Wed May 17 04:47:36 2017 : Error: Errors reading or parsing /etc/raddb/radiusd.conf

[cisco@frank ~]$ radiusd -X
radiusd: FreeRADIUS Version 3.0.1, for host x86_64-redhat-linux-gnu, built on Mar  5 2014 at 05:31:12
Copyright (C) 1999-2014 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
including dictionary file /etc/raddb/dictionary
including configuration file /etc/raddb/radiusd.conf
Unable to open file "/etc/raddb/radiusd.conf": Permission denied
Errors reading or parsing /etc/raddb/radiusd.conf

在root环境下:

[root@frank ~]# radiusd -X
radiusd: FreeRADIUS Version 3.0.1, for host x86_64-redhat-linux-gnu, built on Mar  5 2014 at 05:31:12
Copyright (C) 1999-2014 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
including dictionary file /etc/raddb/dictionary
including configuration file /etc/raddb/radiusd.conf
including configuration file /etc/raddb/proxy.conf
including configuration file /etc/raddb/clients.conf
......
 client 10.75.13.13 {
    require_message_authenticator = no
    secret = "cisco"
    shortname = "asr9006-3"
  limit {
    max_connections = 16
    lifetime = 0
    idle_timeout = 30
  }
 }
Failed to add duplicate client asr9006-3
/etc/raddb/clients.conf[297]: Failed to add client 10.75.13.13

按root键正确配置问题后,重新启动或重启,然后再次在用户下进行检查:

[cisco@frank ~]$ systemctl status radiusd
radiusd.service - FreeRADIUS high performance RADIUS server.
   Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled)
   Active: active (running) since Wed 2017-05-17 05:10:15 CST; 10min ago
  Process: 2438 ExecStart=/usr/sbin/radiusd -d /etc/raddb (code=exited, status=0/SUCCESS)
  Process: 1956 ExecStartPre=/usr/sbin/radiusd -C (code=exited, status=0/SUCCESS)
  Process: 1951 ExecStartPre=/bin/chown -R radiusd.radiusd /var/run/radiusd (code=exited, status=0/SUCCESS)
 Main PID: 2439 (radiusd)
   CGroup: /system.slice/radiusd.service
           └─2439 /usr/sbin/radiusd -d /etc/raddb
相关问题