Startup problem with ldap

Massimo Meregalli maxmere at ml.mbox.it
Fri Nov 2 11:06:59 CET 2007


Hi,
                I'm trying to run a freeradius 1.1.7 with ldap as
        authorize and
        authenticate backend and I'm having trouble with freeradius
        startup.
        
                If the server is started with radiusd -X or radiusd -s
        all is fine and
        the requests get answered correctly.
        
                If the server is started with radiusd -y it doesn't
        statup correctly.
        >From the radiusd.log file I notice that the line
        
                Fri Nov  2 09:37:54 2007 : Info: Ready to process
        requests.
        
                is missing. If I comment the ldap section in authorize
        and authenticate
        the server startup correcly also with -y startup flag.
        
                I've tried some debugging and I found that the server
        will fork
        correctly, the parent exit but the child never come alive as the
        line
        "Here before setsid" dosn't compare in the logfile.
        
                I've also tried to start gdb on the running process to
        see where the
        process is and the results are reported at the end of the
        message.
        
        Here there are the modified section of radiusd.c, the
        radiusd.log and
        the output of the gdb session.
         
        
        ::::::::::
        radiusd.c:
        :::::::::: 
                .....
                /*
                 *  Disconnect from session
                 */
                if (debug_flag == 0 && dont_fork == FALSE) {
                        pid = fork();
                        if(pid < 0) {
                                radlog(L_ERR|L_CONS, "Couldn't fork");
                                exit(1);
                        }
        
                        /*
                         *  The parent exits, so the child can run in
        the
        background.
                         */
                        if(pid > 0) {
        radlog(L_ERR, "Parent Exit");
                                exit(0);
                        }
        radlog(L_ERR, "Here before setsid");
        #ifdef HAVE_SETSID
                        setsid();
        #endif
                ......
                 
        ::::::::::::
        radiusd.log:
        ::::::::::::
        
        Fri Nov  2 09:56:33 2007 : Info: rlm_exec: Wait=yes but no
        output
        defined. Did you mean output=none?
        Fri Nov  2 09:56:33 2007 : Info: rlm_sql (sql): Driver
        rlm_sql_postgresql (module rlm_sql_postgresql) loaded and linked
        Fri Nov  2 09:56:33 2007 : Info: rlm_sql (sql): Attempting to
        connect to
        radius at localhost:/radius
        Fri Nov  2 09:56:33 2007 : Error: Parent Exit
        
        
        :::::::::
        gdb
        :::::::::
        [root at stargate main]# gdb .libs/radiusd 20867
        GNU gdb Red Hat Linux (6.6-16.fc7rh)
        Copyright (C) 2006 Free Software Foundation, Inc.
        GDB is free software, covered by the GNU General Public License,
        and you
        are
        welcome to change it and/or distribute copies of it under
        certain
        conditions.
        Type "show copying" to see the conditions.
        There is absolutely no warranty for GDB.  Type "show warranty"
        for
        details.
        This GDB was configured as "i386-redhat-linux-gnu"...
        Using host libthread_db library "/lib/libthread_db.so.1".
        Attaching to
        program: /usr/src/redhat/BUILD/freeradius-1.1.7/src/main/.libs/radiusd,
        process 20867
        Loaded symbols
        for /usr/src/redhat/BUILD/freeradius-1.1.7/src/main/.libs/radiusd
        Reading symbols from /lib/libnsl.so.1...done.
        Loaded symbols for /lib/libnsl.so.1
        Reading symbols from /lib/libresolv.so.2...done.
        Loaded symbols for /lib/libresolv.so.2
        Reading symbols from /lib/libpthread.so.0...done.
        [Thread debugging using libthread_db enabled]
        [New Thread -1209166144 (LWP 20867)]
        Loaded symbols for /lib/libpthread.so.0
        Reading symbols from /usr/lib/libradius-1.1.7.so...done.
        Loaded symbols for /usr/lib/libradius-1.1.7.so
        Reading symbols from /lib/libcrypt.so.1...done.
        Loaded symbols for /lib/libcrypt.so.1
        Reading symbols from /usr/lib/libsnmp.so.15...done.
        Loaded symbols for /usr/lib/libsnmp.so.15
        Reading symbols from /usr/lib/libltdl.so.3...done.
        Loaded symbols for /usr/lib/libltdl.so.3
        Reading symbols from /lib/libdl.so.2...done.
        Loaded symbols for /lib/libdl.so.2
        Reading symbols from /lib/libssl.so.6...done.
        Loaded symbols for /lib/libssl.so.6
        Reading symbols from /lib/libcrypto.so.6...done.
        Loaded symbols for /lib/libcrypto.so.6
        Reading symbols from /lib/libc.so.6...done.
        Loaded symbols for /lib/libc.so.6
        Reading symbols from /lib/ld-linux.so.2...done.
        Loaded symbols for /lib/ld-linux.so.2
        Reading symbols from /usr/lib/libgssapi_krb5.so.2...done.
        Loaded symbols for /usr/lib/libgssapi_krb5.so.2
        Reading symbols from /usr/lib/libkrb5.so.3...done.
        Loaded symbols for /usr/lib/libkrb5.so.3
        Reading symbols from /lib/libcom_err.so.2...done.
        Loaded symbols for /lib/libcom_err.so.2
        Reading symbols from /usr/lib/libk5crypto.so.3...done.
        Loaded symbols for /usr/lib/libk5crypto.so.3
        Reading symbols from /lib/libz.so.1...done.
        Loaded symbols for /lib/libz.so.1
        Reading symbols from /usr/lib/libkrb5support.so.0...done.
        Loaded symbols for /usr/lib/libkrb5support.so.0
        Reading symbols from /lib/libkeyutils.so.1...done.
        Loaded symbols for /lib/libkeyutils.so.1
        Reading symbols from /lib/libnss_files.so.2...done.
        Loaded symbols for /lib/libnss_files.so.2
        Reading symbols from /usr/lib/libnss_ldap.so.2...done.
        Loaded symbols for /usr/lib/libnss_ldap.so.2
        Reading symbols from /usr/lib/libldap-2.3.so.0...done.
        Loaded symbols for /usr/lib/libldap-2.3.so.0
        Reading symbols from /usr/lib/liblber-2.3.so.0...done.
        Loaded symbols for /usr/lib/liblber-2.3.so.0
        Reading symbols from /usr/lib/libsasl2.so.2...done.
        Loaded symbols for /usr/lib/libsasl2.so.2
        Reading symbols from /usr/lib/rlm_exec.so...done.
        Loaded symbols for /usr/lib/rlm_exec.so
        Reading symbols from /usr/lib/rlm_expr.so...done.
        Loaded symbols for /usr/lib/rlm_expr.so
        Reading symbols from /usr/lib/rlm_chap.so...done.
        Loaded symbols for /usr/lib/rlm_chap.so
        Reading symbols from /usr/lib/rlm_mschap.so...done.
        Loaded symbols for /usr/lib/rlm_mschap.so
        Reading symbols from /usr/lib/rlm_ldap.so...done.
        Loaded symbols for /usr/lib/rlm_ldap.so
        Reading symbols from /usr/lib/libldap_r-2.3.so.0...done.
        Loaded symbols for /usr/lib/libldap_r-2.3.so.0
        Reading symbols from /usr/lib/rlm_eap.so...done.
        Loaded symbols for /usr/lib/rlm_eap.so
        Reading symbols from /usr/lib/libeap-1.1.7.so...done.
        Loaded symbols for /usr/lib/libeap-1.1.7.so
        Reading symbols from /usr/lib/rlm_eap_md5.so...done.
        Loaded symbols for /usr/lib/rlm_eap_md5.so
        Reading symbols from /usr/lib/rlm_eap_leap.so...done.
        Loaded symbols for /usr/lib/rlm_eap_leap.so
        Reading symbols from /usr/lib/rlm_eap_gtc.so...done.
        Loaded symbols for /usr/lib/rlm_eap_gtc.so
        Reading symbols from /usr/lib/rlm_eap_mschapv2.so...done.
        Loaded symbols for /usr/lib/rlm_eap_mschapv2.so
        Reading symbols from /usr/lib/rlm_preprocess.so...done.
        Loaded symbols for /usr/lib/rlm_preprocess.so
        Reading symbols from /usr/lib/rlm_detail.so...done.
        Loaded symbols for /usr/lib/rlm_detail.so
        Reading symbols from /usr/lib/rlm_realm.so...done.
        Loaded symbols for /usr/lib/rlm_realm.so
        Reading symbols from /usr/lib/rlm_files.so...done.
        Loaded symbols for /usr/lib/rlm_files.so
        Reading symbols from /usr/lib/rlm_acct_unique.so...done.
        Loaded symbols for /usr/lib/rlm_acct_unique.so
        Reading symbols from /usr/lib/rlm_radutmp.so...done.
        Loaded symbols for /usr/lib/rlm_radutmp.so
        Reading symbols from /usr/lib/rlm_sql.so...done.
        Loaded symbols for /usr/lib/rlm_sql.so
        Reading symbols from /usr/lib/rlm_sql_postgresql.so...done.
        Loaded symbols for /usr/lib/rlm_sql_postgresql.so
        Reading symbols from /usr/lib/libpq.so.5...done.
        Loaded symbols for /usr/lib/libpq.so.5
        0x0012d402 in __kernel_vsyscall ()
        
        (gdb) backtrace
        #0  0x0012d402 in __kernel_vsyscall ()
        #1  0x00166a0e in __lll_mutex_lock_wait ()
        from /lib/libpthread.so.0
        #2  0x00162883 in _L_mutex_lock_79 () from /lib/libpthread.so.0
        #3  0x001623ad in pthread_mutex_lock ()
        from /lib/libpthread.so.0
        #4  0x00704e6d in ldap_pvt_thread_mutex_lock ()
        from /usr/lib/libldap_r-2.3.so.0
        #5  0x0070f79b in ldap_ld_free ()
        from /usr/lib/libldap_r-2.3.so.0
        #6  0x00663dd7 in ?? () from /usr/lib/libnss_ldap.so.2
        #7  0x00667504 in ?? () from /usr/lib/libnss_ldap.so.2
        #8  0x004892f2 in fork () from /lib/libc.so.6
        #9  0x001693a4 in fork () from /lib/libpthread.so.0
        #10 0xb7f017b1 in main (argc=2, argv=0xbffe0294) at
        radiusd.c:1006
        
        
        
        Any help apprecieated.
        
        Thanks
        
        Massimo Meregalli
        




More information about the Freeradius-Users mailing list