Menu

not quite working with FreeBSD...

Help
tomalok
2004-05-27
2004-05-28
  • tomalok

    tomalok - 2004-05-27

    i've been trying to get libnss-mysql working on FreeBSD 5.2.1-RELEASE.  i have it compiled, installed, and talking to the database -- but the system just doesn't seem to want to actually USE the information it retrieves.

    FreeBSD isn't my operating system of choice, so i'm not 100% sure i've got everything set up correctly.

    i've installed the libnss-mysql port (v1.2), and set up
    /usr/local/etc/libnss-mysql{,-root}.cfg with queries I know work.

    I've set up /etc/nsswitch.conf:
    passwd: files mysql
    group: files mysql

    but when I 'id username' from the command line or try a getpwnam('username') from a perl script, i'm not getting the user information that's in the database.

    when i strace id and the perl script, i see it making the query and reading the correct information -- FreeBSD just isn't using it for some reason.

    anyone know what might be going on?

    thanks...

     
    • Ben Goodwin

      Ben Goodwin - 2004-05-27

      hm...
      is nscd running?
      are you running these commands as root or non-root?
      Can you send me (cinergi @t users.sourceforge.net) a copy of your strace and your configs (after removing any sensitive info)?

       
      • tomalok

        tomalok - 2004-05-27

        nscd is not running.

        same result, no matter if i'm root or an ordinary everyday user.

        i'll work on getting the strace output to you.

         
        • Ben Goodwin

          Ben Goodwin - 2004-05-28

          OK got the strace.  looks like the hanging strace (hangs for me too) is known:
          http://www.freebsd.org/cgi/query-pr.cgi?pr=62377

          However it turns out FreeBSD's 'truss' command works ..  although its output isn't as verbose.

          In any case, your SQL query doesn't return the right rows.  For getpwnam it needs:
          username, password, uid, gid, pwchange, class, gecos, homedir, shell, expire

          For details on what each query needs check out the example here:

          http://libnss-mysql.sourceforge.net/libnss-mysql/sample/freebsd/libnss-mysql.cfg

          Your other queries appear to be OK.

          Are there any complaints in your system logs?  I'd have thought libnss-mysql would whine about too few columns returned in the query.

          Also, are you missing columns entirely your fault or based on some sample configs or documentation out there that needs updating?

           
    • tomalok

      tomalok - 2004-05-28

      d'oh!  yeah, i forgot about the extra three fields that freebsd has compared to linux.

      but, i wasn't seeing anything in the system logs complaining about that fact, either.

       
      • Ben Goodwin

        Ben Goodwin - 2004-05-28

        Cool.  I'm making a note to fix that in 1.3

         

Log in to post a comment.