Menu

Weird behaviour on FreeBSD

Help
Andy
2005-06-30
2013-04-17
  • Andy

    Andy - 2005-06-30

    Greetings,

    I installed libnss-mysql-1.3 from the FreeBSD-5.4-release ports tree, and did the config part. I already had a sql-db from an older linux-libnss-installation. After adding pwchange/class to the table, it worked on this machine.

    But now this box decribed above is the server to twenty diskless clients, which all borrow his / and his /usr, and have some configs of their own in /etc.

    On this boxes, I can `finger <user>` ok, but I can't login with this names. The logfile tells me:

    (debug.log)

    <time> <servicename> NSSWITCH(nss_method_lookup): mysql, passwd, endpwent, not found

    where servicename is `login` and `cron`.

    The same message appeares in the servers debug.log, but only from cron and sm-msp-queue

    Help need

    So long
    Andy

     
    • Andy

      Andy - 2005-07-05

      I guess that behaviour isn't that strange.

      Could it be the problem that endpwent, getpwnam_r aren't defined in either libnss-mysql.cfg nor libnss-mysql-root.cfg?

      How should a definition look like? It seems to work for login, but it does not for sshd and cron yet.

      Andy

       
      • Ben Goodwin

        Ben Goodwin - 2005-07-06

        Quick answer: you need to add MySQL lib dir to your library search path FAR before the startup file in /usr/local/etc/rc.d/000.mysql-client.sh does.  To do so, edit /etc/rc.conf and add a line like the following:

        ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/lib/mysql"

        And reboot the machine (or restart crond, sshd, and any other affected daemons, but a reboot is cleanest and tests to make sure my fix works).

        I'll make a note about this in the documentation.

        As for your config file - the provided config has *all* the queries you'd ever need.  "endpwent" and "getpwnam_r" aren't valid configuration directives.

         
        • Krzysiek

          Krzysiek - 2006-09-26

          This advice works for me on FreeBSD 5.4 and 6.1, thanks!

           
      • Ben Goodwin

        Ben Goodwin - 2005-07-06

        Can root read /etc/libnss-mysql-root.cfg?  I'm wondering if there's a root-NFS issue here.

        If so, I'll need the output of the strace command (see the DEBUGGING document) emailed to me (as an attachment in order to preserve formatting).

         
    • Andy

      Andy - 2005-07-06

      Ok, that seems to work except for cron, he still brings up this messages... but much more important for me, is the following:

      I have a diskless client running from the server mentioned above, having his shared / and /usr. I can look up users via id, this works without problems, but I cannot login with them (I can, however, locally on the server). No messages in syslog...

      Do you have an idea to that too?
      Thank you very much for your support

      Andy

       
      • Ben Goodwin

        Ben Goodwin - 2005-07-06

        Are you using 'sudo' to restart cron?  As soon as I restarted it, that fixed it for me so I'm puzzled why it's not working for you.

        What's your 'server' specification in your /etc/libnss-mysql.cfg?

         
    • Andy

      Andy - 2005-07-06

      not, which might be obvious, localhost but the hostname, brainbug (which is mapped to an ip in the clients /etc/hosts)

      I'll have a closer look at the cron thing tomorrow, but the client-problem is much more important to me atm

       
    • Andy

      Andy - 2005-07-07

      FreeBSD-style, the configs are in /usr/local/etc which is mounted with /usr as read only. I'll have a close look at permissions and will mail you the strace output as soon as possible...

       

Log in to post a comment.