Bug 1421116 - radiusd doesn't find configuration file if the binary file of radiusd is renamed
Summary: radiusd doesn't find configuration file if the binary file of radiusd is renamed
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: freeradius
Version: 7.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Nikolai Kondrashov
QA Contact: Jaroslav Aster
Depends On:
TreeView+ depends on / blocked
Reported: 2017-02-10 11:55 UTC by Jaroslav Aster
Modified: 2019-03-06 02:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-02-16 14:21:30 UTC
Target Upstream Version:

Attachments (Terms of Use)

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):


How reproducible:


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.

Note You need to log in before you can comment on or make changes to this bug.