What does 'radius -C' do? (2.1.3)
According to the documentation, radiusd -C is supposed to "Check configuration and exit." I was assuming that would catch errors in the configuration that might prevent it from restarting. However, if I intentionally mangle the configuration to the point it won't start, the -C check still returns nothing. What am I missing? -Mike
Mike Diggins wrote:
According to the documentation, radiusd -C is supposed to "Check configuration and exit." I was assuming that would catch errors in the configuration that might prevent it from restarting. However, if I intentionally mangle the configuration to the point it won't start, the -C check still returns nothing. What am I missing?
Could you give *examples* of what doesn't work? And which version are you running? 1.1.x might have "-C", but it definitely doesn't work. 2.1.x should be a lot better. Alan DeKok.
Hi,
Mike Diggins wrote:
According to the documentation, radiusd -C is supposed to "Check configuration and exit." I was assuming that would catch errors in the configuration that might prevent it from restarting. However, if I intentionally mangle the configuration to the point it won't start, the -C check still returns nothing. What am I missing?
Could you give *examples* of what doesn't work?
And which version are you running? 1.1.x might have "-C", but it definitely doesn't work. 2.1.x should be a lot better.
2.1.3 was mentioned in the subject title... radiusd -XC does most things okay here... radiusd: #### Skipping IP addresses and Ports #### Configuration appears to be OK. though i did note from its reintroduction into the code that it skips the listening stuff. ponder if thats where his config is borked? alan
A.L.M.Buxey@lboro.ac.uk wrote:
2.1.3 was mentioned in the subject title...
Maybe I should read the messages.
radiusd -XC does most things okay here...
radiusd: #### Skipping IP addresses and Ports #### Configuration appears to be OK.
though i did note from its reintroduction into the code that it skips the listening stuff. ponder if thats where his config is borked?
It checks: a) if the configuration files are formatted correctly b) if some modules can be loaded If more things "need" to be checked, we will "need" a patch to add that functionality. Alan DeKok.
Just as a quick example, I added this line to radius.conf: $INCLUDE dsdfsdf/ # bogus line radiusd -C doesn't complain: [root@rad01 raddb]# /usr/local/freeradius/sbin/radiusd -C [root@rad01 raddb]# But: Radius -XC does: including files in directory /usr/local/freeradius/etc/raddb/dsdfsdf/ /usr/local/freeradius/etc/raddb/radiusd.conf[96]: Error reading directory /usr/local/freeradius/etc/raddb/dsdfsdf/: No such file or directory Errors reading /usr/local/freeradius/etc/raddb/radiusd.conf [root@prad01 raddb]# Basically I just wanted to do a quick syntax check to ensure radius will start, in case I mangle something in the config. -Mike On Mon, 9 Mar 2009, Alan DeKok wrote:
A.L.M.Buxey@lboro.ac.uk wrote:
much as thought. is it also the case that it only checks stuff that can be 'HUP'd' ?
Yes.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Mike Diggins wrote:
Just as a quick example, I added this line to radius.conf:
$INCLUDE dsdfsdf/ # bogus line
radiusd -C doesn't complain:
[root@rad01 raddb]# /usr/local/freeradius/sbin/radiusd -C [root@rad01 raddb]#
Err.. try "echo $?" after that. It doesn't print out log messages to stdout unless you also do "-X".
But:
Radius -XC does:
including files in directory /usr/local/freeradius/etc/raddb/dsdfsdf/ /usr/local/freeradius/etc/raddb/radiusd.conf[96]: Error reading directory /usr/local/freeradius/etc/raddb/dsdfsdf/: No such file or directory Errors reading /usr/local/freeradius/etc/raddb/radiusd.conf [root@prad01 raddb]#
Basically I just wanted to do a quick syntax check to ensure radius will start, in case I mangle something in the config.
radiusd -C if [ "$?" eq "0" ]; then echo OK else echo FAILED something fi Alan DeKok.
On Mon, 9 Mar 2009, Alan DeKok wrote:
Mike Diggins wrote:
Just as a quick example, I added this line to radius.conf:
$INCLUDE dsdfsdf/ # bogus line
radiusd -C doesn't complain:
[root@rad01 raddb]# /usr/local/freeradius/sbin/radiusd -C [root@rad01 raddb]#
Err.. try "echo $?" after that. It doesn't print out log messages to stdout unless you also do "-X".
But:
Radius -XC does:
including files in directory /usr/local/freeradius/etc/raddb/dsdfsdf/ /usr/local/freeradius/etc/raddb/radiusd.conf[96]: Error reading directory /usr/local/freeradius/etc/raddb/dsdfsdf/: No such file or directory Errors reading /usr/local/freeradius/etc/raddb/radiusd.conf [root@prad01 raddb]#
Basically I just wanted to do a quick syntax check to ensure radius will start, in case I mangle something in the config.
radiusd -C if [ "$?" eq "0" ]; then echo OK else echo FAILED something fi
Alan DeKok.
Ah, ok, So it just returns an error level. That will do. Thanks. -Mike
Hi,
Err.. try "echo $?" after that. It doesn't print out log messages to stdout unless you also do "-X".
I was about to say the same thing - the man page clearly states that it fails with a value - this is a shell fail, not a human readble fail - exit value isnt 0 therefore something is wrong. many many daemons work in the same way -
radiusd -C if [ "$?" eq "0" ]; then echo OK else echo FAILED something fi
- and have this sort of wrapper or logic. :-) alan
participants (3)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Mike Diggins