systemctl start-up not working correctly

J Kephart jkephart at safetynetaccess.com
Tue Mar 12 14:00:43 CET 2019


Good morning!  I'm seeing some strange behavior when I attempt to start 
FreeRADIUS (3.0.18) using the systemctl command on CentOS 7.  After 
issuing the 'start' command, I'm left staring at a blank line for about 
a minute; systemctl then exits and radiusd appears to be running. 
However, watching the radius.log file, what I see is something like this:

Tue Mar 12 08:39:15 2019 : Info: Debugger not attached
Tue Mar 12 08:39:15 2019 : Info: rlm_sql (sql): Driver rlm_sql_mysql 
(module rlm_sql_mysql) loaded and linked
Tue Mar 12 08:39:15 2019 : Info: rlm_sql_mysql: libmysql version: 
10.1.38-MariaDB
Tue Mar 12 08:39:15 2019 : Info: rlm_sql (sql): Attempting to connect to 
database "radius"
Tue Mar 12 08:39:15 2019 : Info: Loaded virtual server <default>
Tue Mar 12 08:39:15 2019 : Warning: Ignoring "ldap" (see 
raddb/mods-available/README.rst)
Tue Mar 12 08:39:15 2019 : Info: Loaded virtual server default
Tue Mar 12 08:39:15 2019 : Info:  # Skipping contents of 'if' as it is 
always 'false' -- /etc/raddb/sites-enabled/inner-tunnel:339
Tue Mar 12 08:39:15 2019 : Info: Loaded virtual server inner-tunnel
Tue Mar 12 08:39:15 2019 : Info: Ready to process requests
Tue Mar 12 08:40:45 2019 : Info: Signalled to terminate
Tue Mar 12 08:40:45 2019 : Info: Exiting normally
Tue Mar 12 08:40:50 2019 : Info: Debugger not attached
Tue Mar 12 08:40:50 2019 : Info: rlm_sql (sql): Driver rlm_sql_mysql 
(module rlm_sql_mysql) loaded and linked
Tue Mar 12 08:40:50 2019 : Info: rlm_sql_mysql: libmysql version: 
10.1.38-MariaDB
Tue Mar 12 08:40:50 2019 : Info: rlm_sql (sql): Attempting to connect to 
database "radius"
Tue Mar 12 08:40:50 2019 : Info: Loaded virtual server <default>
Tue Mar 12 08:40:50 2019 : Warning: Ignoring "ldap" (see 
raddb/mods-available/README.rst)
Tue Mar 12 08:40:50 2019 : Info: Loaded virtual server default
Tue Mar 12 08:40:50 2019 : Info:  # Skipping contents of 'if' as it is 
always 'false' -- /etc/raddb/sites-enabled/inner-tunnel:339
Tue Mar 12 08:40:50 2019 : Info: Loaded virtual server inner-tunnel
Tue Mar 12 08:40:50 2019 : Info: Ready to process requests
Tue Mar 12 08:41:33 2019 : Info: Signalled to terminate
Tue Mar 12 08:41:33 2019 : Info: Exiting normally
Tue Mar 12 08:41:36 2019 : Info: Debugger not attached
Tue Mar 12 08:41:36 2019 : Info: rlm_sql (sql): Driver rlm_sql_mysql 
(module rlm_sql_mysql) loaded and linked
Tue Mar 12 08:41:36 2019 : Info: rlm_sql_mysql: libmysql version: 
10.1.38-MariaDB
Tue Mar 12 08:41:36 2019 : Info: rlm_sql (sql): Attempting to connect to 
database "radius"
Tue Mar 12 08:41:36 2019 : Info: Loaded virtual server <default>
Tue Mar 12 08:41:36 2019 : Warning: Ignoring "ldap" (see 
raddb/mods-available/README.rst)
Tue Mar 12 08:41:36 2019 : Info: Loaded virtual server default
Tue Mar 12 08:41:36 2019 : Info:  # Skipping contents of 'if' as it is 
always 'false' -- /etc/raddb/sites-enabled/inner-tunnel:339
Tue Mar 12 08:41:36 2019 : Info: Loaded virtual server inner-tunnel
Tue Mar 12 08:41:36 2019 : Info: Ready to process requests

As you can see, about once every minute and a half or so, something is 
signalling radiusd to exit, and it then restarts. If I use 'radiusd -X' 
(I've not included that output because everything looks perfectly 
normal), everything starts normally, and then it just waits patiently 
for connections, but it never terminates and restarts.  Similarly, if I 
start it using just the command 'radiusd', everything works as it 
should.  It's looks as though there's something amiss with the systemctl 
radius.service file.  For the life or me, though, I can't figure out 
what, and I've never seen this sort of behavior before.  In case anyone 
wonders, here's the radiusd.service contents:

[Unit]
Description=FreeRADIUS multi-protocol policy server
After=network-online.target
Documentation=man:radiusd(8) man:radiusd.conf(5) 
http://wiki.freeradius.org/ http://networkradius.com/doc/

[Service]
Type=notify
WatchdogSec=60
NotifyAccess=all
PIDFile=/var/run/radiusd/radiusd.pid
EnvironmentFile=-/etc/sysconfig/radiusd

# FreeRADIUS can do static evaluation of policy language rules based
# on environmental variables which is very useful for doing per-host
# customization.
# Unfortunately systemd does not allow variable substitutions such
# as %H or $(hostname) in the EnvironmentFile.
# We provide HOSTNAME here for convenience.
Environment=HOSTNAME=%H

# Limit memory to 2G this is fine for %99.99 of deployments. FreeRADIUS
# is not memory hungry, if it's using more than this, then there's probably
# a leak somewhere.
MemoryLimit=2G

RuntimeDirectory=radiusd
RuntimeDirectoryMode=0775
ExecStartPre=/usr/sbin/radiusd $FREERADIUS_OPTIONS -Cx -lstdout
ExecStartPre=/usr/bin/chown radiusd:radiusd /var/run/radiusd
ExecStart=/usr/sbin/radiusd $FREERADIUS_OPTIONS
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

I've seen other notes that are *similar* to this, but many refer to the 
process not starting at boot.  This happens at boot, as well as any 
other time we use systemctl to start the service. So, again, it appears 
to be something with the systemctl unit.

Any help will be greatly appreciated.

-- Jim


More information about the Freeradius-Users mailing list