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...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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...
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)?
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.
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?
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.
Cool. I'm making a note to fix that in 1.3