Menu

libnss-mysql with redhat 9

Help
Anonymous
2004-06-08
2004-06-13
  • Anonymous

    Anonymous - 2004-06-08

    I install libnss-mysql 1.2 with redhat 9 using sample files from linux.
    But fails when execute "id cinergi". the following is from /tmp/libnss-mysql-debug.log:
    pls give me a hand.

    [10464]: _nss_mysql_getpwnam_r: ENTER
    [10464]: _nss_mysql_lookup: ENTER
    [10464]: _nss_mysql_init: ENTER
    [10464]: _nss_mysql_load_config: ENTER
    [10464]: _nss_mysql_set_defaults: EXIT
    [10464]: _nss_mysql_load_config_file: ENTER
    [10464]: _nss_mysql_load_config_file: Loading: /etc/libnss-mysql.cfg
    [10464]: _nss_mysql_get_section: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (TRUE)
    [10464]: _nss_mysql_name_to_id: ENTER
    [10464]: _nss_mysql_name_to_id: EXIT (1)
    [10464]: _nss_mysql_get_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_load_section: ENTER
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getpwnam -> SELECT username,'x',uid,gid,gecos,homedir,shell FROM users WHERE username='%s' LIMIT 1
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 87)
    [10464]: _nss_mysql_realloc: EXIT (0x804ec90)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getpwuid -> SELECT username,'x',uid,gid,gecos,homedir,shell FROM users WHERE uid='%u' LIMIT 1
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 82)
    [10464]: _nss_mysql_realloc: EXIT (0x804ecf0)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getspnam -> SELECT username,password,lstchg,min,max,warn,inact,expire,flag FROM users WHERE username='%s' LIMIT 1
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 102)
    [10464]: _nss_mysql_realloc: EXIT (0x804ed48)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getpwent -> SELECT username,'x',uid,gid,gecos,homedir,shell FROM users
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 59)
    [10464]: _nss_mysql_realloc: EXIT (0x804edb8)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getspent -> SELECT username,password,lstchg,min,max,warn,inact,expire,flag FROM users
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 74)
    [10464]: _nss_mysql_realloc: EXIT (0x804edf8)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getgrnam -> SELECT name,password,gid FROM groups WHERE name='%s' LIMIT 1
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 61)
    [10464]: _nss_mysql_realloc: EXIT (0x804ee48)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getgrgid -> SELECT name,password,gid FROM groups WHERE gid='%u' LIMIT 1
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 60)
    [10464]: _nss_mysql_realloc: EXIT (0x804ee90)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: getgrent -> SELECT name,password,gid FROM groups
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 37)
    [10464]: _nss_mysql_realloc: EXIT (0x804eed0)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: memsbygid -> SELECT username FROM grouplist WHERE gid='%u'
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 46)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef00)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: gidsbymem -> SELECT gid FROM grouplist where username='%s'
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 46)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef38)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (TRUE)
    [10464]: _nss_mysql_next_key: EXIT (NSS_NOTFOUND)
    [10464]: _nss_mysql_load_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_get_section: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (TRUE)
    [10464]: _nss_mysql_name_to_id: ENTER
    [10464]: _nss_mysql_name_to_id: EXIT (0)
    [10464]: _nss_mysql_get_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_load_section: ENTER
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: host -> localhost
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 10)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef70)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: database -> auth
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 5)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef80)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: username -> nss-user
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 9)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef90)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: password -> userpass
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc ((nil), 9)
    [10464]: _nss_mysql_realloc: EXIT (0x804efa0)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: timeout -> 3
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: compress -> 0
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: EXIT (NSS_NOTFOUND)
    [10464]: _nss_mysql_load_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_get_section: ENTER
    [10464]: _nss_mysql_get_section: EXIT (NSS_NOTFOUND)
    [10464]: _nss_mysql_load_config_file: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_load_config_file: ENTER
    [10464]: _nss_mysql_load_config_file: Loading: /etc/libnss-mysql-root.cfg
    [10464]: _nss_mysql_get_section: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (TRUE)
    [10464]: _nss_mysql_name_to_id: ENTER
    [10464]: _nss_mysql_name_to_id: EXIT (0)
    [10464]: _nss_mysql_get_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_load_section: ENTER
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: username -> nss-root
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc (0x804ef90, 9)
    [10464]: _nss_mysql_realloc: EXIT (0x804ef90)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: Found: password -> rootpass
    [10464]: _nss_mysql_next_key: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_lis: ENTER
    [10464]: _nss_mysql_realloc: ENTER
    [10464]: _nss_mysql_realloc: realloc (0x804efa0, 9)
    [10464]: _nss_mysql_realloc: EXIT (0x804efa0)
    [10464]: _nss_mysql_lis: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_next_key: ENTER
    [10464]: _nss_mysql_is_bracketed: ENTER
    [10464]: _nss_mysql_is_bracketed: EXIT (FALSE)
    [10464]: _nss_mysql_next_key: EXIT (NSS_NOTFOUND)
    [10464]: _nss_mysql_load_section: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_get_section: ENTER
    [10464]: _nss_mysql_get_section: EXIT (NSS_NOTFOUND)
    [10464]: _nss_mysql_load_config_file: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_validate_config: ENTER
    [10464]: _nss_mysql_validate_config: EXIT (TRUE)
    [10464]: _nss_mysql_load_config: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_init: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_load_config: ENTER
    [10464]: _nss_mysql_load_config: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_build_query: ENTER
    [10464]: _nss_mysql_malloc: ENTER
    [10464]: _nss_mysql_malloc: malloc (15)
    [10464]: _nss_mysql_malloc: EXIT (0x804ea10)
    [10464]: _nss_mysql_escape_string: ENTER
    [10464]: _nss_mysql_connect_sql: ENTER
    [10464]: _nss_mysql_check_existing_connection: ENTER
    [10464]: _nss_mysql_check_existing_connection: EXIT (FALSE)
    [10464]: _nss_mysql_load_config: ENTER
    [10464]: _nss_mysql_load_config: EXIT (NSS_SUCCESS)
    [10464]: _nss_mysql_set_options: ENTER
    [10464]: _nss_mysql_set_options: Setting connect timeout to 3
    [10464]: _nss_mysql_set_options: EXIT
    [10464]: _nss_my

     
    • Ben Goodwin

      Ben Goodwin - 2004-06-08

      your post got chopped off at the end, so I'm missing information I need to help you.  Can you email it to cinergi@users.sourceforge.net?  Thanks!

       
    • Anonymous

      Anonymous - 2004-06-09

      I sent it.
      thanks.

       
      • Ben Goodwin

        Ben Goodwin - 2004-06-10

        OK, from the debug log:

        [1058]: _nss_mysql_connect_sql: Connecting to localhost
        [1058]: _nss_mysql_connect_sql: EXIT (NSS_UNAVAIL)

        so it's having trouble connecting to your MySQL server.  Are you able to execute the following command from that machine:

        mysql -h localhost -u nss-root -prootpass auth

        and get a mysql command prompt?

         
    • Anonymous

      Anonymous - 2004-06-10

      yes i can.

      [root@www root]# /mysql/bin/mysql -h localhost -u nss-root -prootpass auth
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 1 to server version: 4.0.18-max-log

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql>

       
    • Ben Goodwin

      Ben Goodwin - 2004-06-10

      I wonder if you need to specify the path to the socket in /etc/libnss-mysql.cfg?
      What's in your syslog message?  I thought libnss-mysql would log the reason it was unable to connect to the MySQL server but I could be wrong ...

       
    • Anonymous

      Anonymous - 2004-06-11

      I change "host         locahost" to "host         127.0.0.1" , it works now.

      thanks.

       
      • Ben Goodwin

        Ben Goodwin - 2004-06-11

        That's certainly strange.
        Did you typo your message here?  It says "locahost" and not "localhost" but maybe that's just a typo in the forum and not your config? (as the config you provided me is correct)
        Anyway, can you 'ping localhost' ?
        I wonder if MySQL uses TCP instead of sockets when encountering 127.0.0.1 instead of localhost.. I'm still curious what the real problem is, but if you're happy and don't want to investigate further, that's fine :-)

         
    • Anonymous

      Anonymous - 2004-06-11

      Yes I type error in my post.
      But I am sure that it is 'loclahost' in my libnss-mysql.cf.
      BTW i can ping localhost.

       
      • Ben Goodwin

        Ben Goodwin - 2004-06-11

        Did specifying the path to the mysql socket in libnss-mysql.cfg not fix the problem?
        I wonder if, because you've specified an IP instead of 'localhost', you're using sockets or TCP righ tnow.  Does 'netstat -an|grep :3306' show a bunch of lines (especially thsoe in CLOSE_WAIT or TIME_WAIT)?

         
    • Anonymous

      Anonymous - 2004-06-12

      it works fine if i use the mysql socket and 'host localhost' in libnss-mysql.cfg.
      but it doesn't work when i remark the line including mysql socket file path and  use 'host localhost'.

      mysql is running with debugging mode and i can see any connection or query action. when using 'host localhost' without the mysql socket path, i see nothing. i am sure that it didn't make connections in the situation.

       
      • Ben Goodwin

        Ben Goodwin - 2004-06-13

        Did you install from source or no?  Sounds like your mysql client libraries default to the wrong place for the socket.  In any case, using localhost and a specific path to the socket works, and that's perfect.  That's a good setup.

         

Log in to post a comment.