Unable to start freeradius as service - Couldn't connect to MySQL server

vira vva arifvva at gmail.com
Tue Oct 24 07:57:44 UTC 2023


  root at ngw40:/etc/freeradius/mods-enabled# freeradius  -v
radiusd: FreeRADIUS Version 3.2.3 (git #db3d1924d), for host
x86_64-pc-linux-gnu
FreeRADIUS Version 3.2.3
running on terminal without any issue
*freeradius -X*
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default
Listening on auth address :: port 1812 bound to server default
Listening on acct address :: port 1813 bound to server default
Listening on proxy address * port 44685
Listening on proxy address :: port 57364

*run as as service always failed with sql connection issue*

Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
  # Instantiating module "sql" from file /etc/freeradius/mods-enabled/sql
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Info:
rlm_sql_mysql: libmysql version: 8.0.34
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   mysql {
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    tls {
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011ca_file = "/etc/ssl/certs/my_ca.crt"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011ca_path = "/etc/ssl/certs/"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011certificate_file = "/etc/ssl/certs/private/client.crt"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011private_key_file = "/etc/ssl/certs/private/client.key"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011cipher = "DHE-RSA-AES256-SHA:AES128-SHA"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011tls_required = yes
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011check_cert = no
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    #011check_cert_cn = no
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 :
Warning: /etc/freeradius/mods-enabled/sql[94]: The item 'tls_check_cert' is
defined, but is unused by the configuration
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 :
Warning: /etc/freeradius/mods-enabled/sql[95]: The item 'tls_check_cert_cn'
is defined, but is unused by the configuration
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
    }
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011warnings = "auto"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   }
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Info:
rlm_sql (sql): Attempting to connect to database "radius"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql (sql): Initialising connection pool
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   pool {
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011start = 5
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011min = 3
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011max = 32
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011spare = 10
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011uses = 0
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011lifetime = 0
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011cleanup_interval = 30
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011idle_timeout = 60
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011retry_delay = 30
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011max_retries = 5
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   #011spread = no
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
   }
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql (sql): Processing generate_sql_clients
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql (sql) in generate_sql_clients: query is SELECT id, nasname,
shortname, type, secret, server FROM nas
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql (sql): 0 of 0 connections in use.  You  may need to increase "spare"
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Info:
rlm_sql (sql): Opening additional connection (0), 1 of 1 pending slots used
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql_mysql: Starting connect to MySQL server
Oct 24 14:42:43 ngw40 freeradius[168957]: WARNING: MYSQL_OPT_RECONNECT is
deprecated and will be removed in a future version.
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Error:
rlm_sql_mysql: Couldn't connect to MySQL server radius at localhost:radius
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Error:
rlm_sql_mysql: MySQL error: Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2)
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Debug:
rlm_sql_mysql: Socket destructor called, closing socket
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Error:
rlm_sql (sql): Opening connection failed (0)
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Error:
Failed to load clients from SQL
Oct 24 14:42:43 ngw40 freeradius[168957]: Tue Oct 24 14:42:43 2023 : Error:
/etc/freeradius/mods-enabled/sql[27]: Instantiation failed for module "sql"


More information about the Freeradius-Users mailing list