Bug 1421116

Summary: radiusd doesn't find configuration file if the binary file of radiusd is renamed
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Aster <jaster>
Component: freeradiusAssignee: Nikolai Kondrashov <nikolai.kondrashov>
Status: CLOSED NOTABUG QA Contact: Jaroslav Aster <jaster>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: pkis
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 14:21:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Aster 2017-02-10 11:55:10 UTC
Description of problem:

Radiusd doesn't find configuration file if the binary file of radiusd is renamed. It seems that radiusd tries to find configuration file in /etc/raddb based on its binary file name. For example, if radiusd is located in /usr/bin/radiusd.blabla, it tries to find configuration file /etc/raddb/radiusd.blabla.conf, but this file does not exist, so radiusd fails to start.

Version-Release number of selected component (if applicable):

freeradius-3.0.12-1.el7_3


How reproducible:

100%


Steps to Reproduce:

1. Rename radiusd.

# mv /usr/sbin/radiusd /usr/sbin/radiusd.blabla

2. Run radiusd.blabla.

# radiusd.blabla -X
...
...
...
including configuration file /etc/raddb/radiusd.blabla.conf
Unable to open file "/etc/raddb/radiusd.blabla.conf": No such file or directory
Errors reading or parsing /etc/raddb/radiusd.blabla.conf


Actual results:

Radiusd does not find configuration file if it is renamed.


Expected results:

Radiusd finds configuration file if it is renamed.

Comment 2 Nikolai Kondrashov 2017-02-16 12:31:17 UTC
Hmm, why do we need to have radiusd renamed?

Comment 3 Nikolai Kondrashov 2017-02-16 12:37:16 UTC
I suspect that looking up for <program_name>.conf file is a part of core functionality. Perhaps the same library is used to load configuration for different executables and as a "clever" hack to lookup corresponding config file uses the program name.

Comment 4 Jaroslav Aster 2017-02-16 13:39:06 UTC
Hi Nikolai,

I have test which renames radiusd and creates new radiusd file (shell script), which prepares some python environment for renamed radiusd and then calls renamed radiusd. It works in 3.0.4, but it does not work in 3.0.12, because renamed radiusd tries to find configuration file which does not exist.

If you consider it as not-a-bug, I can fix my test. It's up to you.

Comment 5 Nikolai Kondrashov 2017-02-16 13:42:48 UTC
Although I see e.g. Debian removing that functionality in their patches, I think we can live with this. Could you perhaps try changing your test to supply the '-n' option to radiusd?

From the man page:

       -n name
              Read freeradius/name.conf instead of freeradius/radiusd.conf.

You can also move it into a subdirectory without changing the file name.

Tell me if that's unsuitable and we'll try something else.

Comment 6 Jaroslav Aster 2017-02-16 14:18:08 UTC
Ok, workaround works for me, but, sincerely, I don't like it. I think, program would not change configuration file base on its name.

If upstream wants it, you can close this bug :-).

Comment 7 Nikolai Kondrashov 2017-02-16 14:21:30 UTC
Yeah, I don't like it much either, but if it's not a problem for you, nor for users, we should be OK. Please feel free to re-open if it makes your life difficult.