Actions
Bug #4337
closedMultiple radiusd instances are launched upon WAN interface change
Status:
Resolved
Priority:
Low
Assignee:
-
Category:
FreeRADIUS
Target version:
-
Start date:
01/28/2015
Due date:
% Done:
100%
Estimated time:
Plus Target Version:
Affected Version:
2.2
Affected Plus Version:
Affected Architecture:
amd64
Description
I noticed that whenever I change WAN interface settings and apply them multiple radiusd instances are launched. System log looks like this:
Jan 28 18:16:47 radiusd[29916]: /usr/local/etc/raddb/radiusd.conf[36]: Error binding to port for 192.168.20.1 port 1812 Jan 28 18:16:47 radiusd[29916]: Failed binding to authentication address 192.168.20.1 port 1812: Address already in use Jan 28 18:16:47 radiusd[12359]: Loaded virtual server <default> Jan 28 18:16:47 radiusd[29600]: Ready to process requests. Jan 28 18:16:47 radiusd[4843]: Loaded virtual server <default> Jan 28 18:16:47 radiusd[21581]: Exiting normally. Jan 28 18:16:47 radiusd[21581]: Signalled to terminate
As we can see old process 21581 was terminated and 2 new processes 29600 and 29916 were spawned. 29916 dies because 29600 was first to bind to the port 1812.
This is the time line of events:
- /etc/rc.start_packages
- pkg-utils.inc::sync_package($pkgid)
- eval($pkg_config['custom_php_resync_config_command']) RUNS freeradius.inc::freeradius_users_resync()
- service-utils.inc::restart_service('radiusd')
- service-utils.inc::stop_service($name)
- /usr/local/etc/rc.d/radiusd.sh stop NOTE: old process stopped
- service-utils.inc::start_service($name) NOTE: $name is set to "radiusd"
- /usr/local/etc/rc.d/radiusd.sh start NOTE: first process started
- service-utils.inc::start_service($internal_name) NOTE: this is second call to function start_service but $internal_name is set to freeradius2 instead of radiusd so this call does not start a process
- /usr/local/etc/rc.d/radiusd.sh start >>/tmp/bootup_messages 2>&1 & NOTE: this starts second process
This happens because both processes are started almost simultaneously.
If you run "/usr/local/etc/rc.d/radiusd.sh start" while radiusd is running it outputs "radiusd already running? (pid=39987).". That is what I would expect to be saved in /tmp/bootup_messages when second process is started, but "Starting radiusd." is saved in /tmp/bootup_messages instead.
Actions