Summary: | net-dialup/freeradius-1.0.2-r5: use of an ippool makes radiusd crash | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mike Nerone <mike> |
Component: | Current packages | Assignee: | Gentoo Dialup Developers <net-dialup> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | ||
Priority: | High | ||
Version: | 2005.0 | ||
Hardware: | All | ||
OS: | Other | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Mike Nerone
2005-05-19 01:57:53 UTC
Actually, I'm assuming the "threading" part based on the man page. It may actually just be child processes. The /etc/raddb directory gets installed having root:radiusd as owner/group, with 0750 permissions. From the security point of view, it's best to deny write access rights in config directory. This will not going to change. I've uncommented both main_pool lines and tried to start radius. The result was : config not ok! (try /usr/sbin/check-radiusd-config ) After I launched check-radiusd-config, I've learned that it requires write access in /etc/raddb, so I've set 0770 on /etc/raddb. I've started again, and it worked. As I've said before, freeradius has a very complex config file which makes configuration part of the service a little bit bumpy, but check-radiusd-config exist for that reason. I appreciate your advice, but I'm pretty positive that this problem has nothing to do with directory permissions (see below). I do also know about check-radiusd-config, and it has reported a good config all along (sorry I forgot to mention that - it might have prevented the report from being immediately pigeon-holed). ############################################################################### # grep main_pool /etc/raddb/radiusd.conf # Show that lines are *not* commented ippool main_pool { main_pool main_pool # true > /var/log/radius/radius.log # Clear the log # tail -f /var/log/radius/radius.log & # So we can see the log output [1] 26879 # ls -ld /etc/raddb # Currently 750 drwxr-x--- 3 root radiusd 1024 May 19 03:47 /etc/raddb # check-radiusd-config # "Killed" line is normal. Looks good. /usr/sbin/check-radiusd-config: line 55: 26882 Killed $sbindir/radiusd -X -p 32768 >startup.log 2>&1 Radius server configuration looks OK. # radiusd # Attempt to start service Fri May 20 01:50:01 2005 : Info: Starting - reading configuration files ... Fri May 20 01:50:01 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 01:50:01 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 01:50:01 2005 : Error: Couldn't fork <<<<<----- It dies # chmod 770 /etc/raddb # radiusd Fri May 20 01:51:06 2005 : Info: Starting - reading configuration files ... Fri May 20 01:51:06 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 01:51:06 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 01:51:06 2005 : Error: Couldn't fork <<<<<----- It *still* dies # radiusd -s & [2] 26903 Fri May 20 01:51:23 2005 : Info: Starting - reading configuration files ... Fri May 20 01:51:23 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 01:51:23 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 01:51:23 2005 : Info: Ready to process requests. <<<<<----- Single-server mode works fine. # killall radiusd # [2]+ Done radiusd -s # [[[ Here, I edit radiusd.conf and simply recomment the two lines ]]] # radiusd # Start service normally again Fri May 20 02:01:28 2005 : Info: Starting - reading configuration files ... Fri May 20 02:01:28 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 02:01:28 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 02:01:28 2005 : Info: Ready to process requests. <<<<<----- Works fine with those lines commented. ############################################################################### I can further assure you that I didn't mess up the config, because I used the default config to test the issue before reporting it. The only extra action I took was "cd /etc/raddb; touch db.ipindex db.ippool; chown radiusd:radiusd db.ip*" in order to solve the permissions problem without opening up the whole directory. In fact, I just repeated this test from a fresh ebuild-provided config, with the same results: uncommenting those lines produces the failure and the same error message as above and in my original report. Just to really convince you, I repeated the test from the default config *again*, but this time using your recommendation: I removed /etc/raddb and reinstalled freeradius, then did "chmod 770 /etc/raddb", and tested that radiusd runs correctly (it did). I then uncommented the two lines I've referenced, and tested that it failed. It did, with the same error message once again. Truly, I'm not crazy, and I'm not altogether unintelligent. :P There's a problem here - whether it's architecture-specific or something like that I do not know, but it exists. By the way, it makes sense that check-radiusd-config detects no errors, because it relies on running radiusd in single-server mode (-X has that effect, too) to do its detection. do the following test: - stop de radius daemon - rename /etc/raddb - upgrade to freeradius-1.0.2-r5 - run etc-update and replace the files with the newer version - uncomment main_pool lines - set 0770 permissions on /etc/raddb - run /etc/init.d/radiusd start btw, this is my use configuration (on which main_pool works): equery uses freeradius [ Searching for packages matching freeradius... ] [ Colour Code : set unset ] [ Legend : Left column (U) - USE flags from make.conf ] [ : Right column (I) - USE flags packages was installed with ] [ Found these USE variables for net-dialup/freeradius-1.0.2-r5 ] U I + + edirectory : Enable Novell eDirectory integration - - frascend : Enable Ascend binary mode - - frnothreads : Disable thread support - - frxp : Enable experimental modules + + kerberos : Adds kerberos support + + ldap : Adds LDAP support (Lightweight Directory Access Protocol) + + mysql : Adds mySQL support + + pam : <unknown> + + postgres : Adds support for the postgresql database + + snmp : Adds support for the Simple Network Management Protocol if available + + ssl : Adds support for Secure Socket Layer connections - - udpfromto : Compile in UDPFROMTO support radius.log is: Fri May 20 10:58:42 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 10:58:42 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 10:58:42 2005 : Info: Ready to process requests. Though the bug itself doesn't seem to be solved, the new init.d method appears to work around it. Using radwatch (which the init.d script did not use before -r5), radiusd is run with "-f", making it stay in the foreground and not do the initial fork. As long as this doesn't prevent threading or forking *children* (whichever the case may be), I'm ok with that. Can you possibly confirm that this is the case? I.e. that this is not actually single-server mode in disguise? Anyways, here is my log which shows that the root problem still exists, though: ############################################################################## # ps auxww | grep -v grep | grep radiusd (Check it's not running) # true > /var/log/radius/radius.log # Clear the log # tail -f /var/log/radius/radius.log & # So we can see the log output [1] 25963 # mv /etc/raddb /etc/raddb.bak # emerge =freeradius-1.0.2-r5 <SNIP> # etc-update <SNIP - /etc/init.d/radiusd was the only update, which I accepted> # ls /var/run/radiusd ls: /var/run/radiusd: No such file or directory [Bug #93152 hasn't been fixed yet, so next couple of lines:] # mkdir /var/run/radiusd # chown radiusd:radiusd /var/run/radiusd # chmod 770 /etc/raddb # radiusd # Just to make sure it starts off working Fri May 20 03:35:33 2005 : Info: Starting - reading configuration files ... Fri May 20 03:35:33 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 03:35:33 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 03:35:33 2005 : Info: Ready to process requests. <<-- Works for now. # killall radiusd # vim /etc/raddb/radiusd.conf <I uncommented the two main_pool lines here> # radiusd Fri May 20 03:38:22 2005 : Info: Starting - reading configuration files ... Fri May 20 03:38:22 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 03:38:22 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 03:38:23 2005 : Error: Couldn't fork <<-- Busted. # /etc/init.d/radiusd start * Re-caching dependency info (mtimes differ)... * Starting radiusd... [ ok ] Fri May 20 03:49:51 2005 : Info: Using deprecated naslist file. Support for this will go away soon. Fri May 20 03:49:51 2005 : Info: rlm_exec: Wait=yes but no output defined. Did you mean output=none? Fri May 20 03:49:51 2005 : Info: Ready to process requests. <<-- Yippee! I think. # equery uses freeradius [ Searching for packages matching freeradius... ] [ Colour Code : set unset ] [ Legend : Left column (U) - USE flags from make.conf ] [ : Right column (I) - USE flags packages was installed with ] [ Found these USE variables for net-dialup/freeradius-1.0.2-r5 ] U I - - edirectory : Enable Novell eDirectory integration - - frascend : Enable Ascend binary mode - - frnothreads : Disable thread support - - frxp : Enable experimental modules - - kerberos : Adds kerberos support - - ldap : Adds LDAP support (Lightweight Directory Access Protocol) - - mysql : Adds mySQL support + + pam : <unknown> - - postgres : Adds support for the postgresql database - - snmp : Adds support for the Simple Network Management Protocol if available + + ssl : Adds support for Secure Socket Layer connections - - udpfromto : Compile in UDPFROMTO support # ############################################################################## BTW, the new initscript works with my actual config, as well. That includes the mode 750 /etc/raddb (though, as I said, I had to touch and chown the actual files radiusd wants write access to in there). Another BTW...I just noticed that the radwatch manpage complains rather loudly that it should not be used. Hrm... I'm afraid that freeradius is filled with such half-implemented features. Nothing we can do, so I will mark it as CANTFIX. As for the future possible removal of the radwatch, nothing to be afraid of. After all, it is a very simple bash script, so it could easily be replaced by us. I prefer to use init scripts than use daemontools and instruct our users how to get things done. Remember, every package should work out of the box, which is kind of impossible with daemontools. Sure, no one says you cannot use a daemontools script if you want to, but most users are expecting a proper init script. Have you already moved the bug upstream (http://bugs.gentoo.org/whatisthis.html)? feel free to send upstream a bug report. Submitted upstream at http://bugs.freeradius.org/show_bug.cgi?id=238, including another tidbit my tests have shown, which is that this only seems to affect my Duron machine. |