|
|
Subscribe / Log in / New account

C library system-call wrappers, or the lack thereof

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 12:42 UTC (Wed) by nix (subscriber, #2304)
In reply to: C library system-call wrappers, or the lack thereof by drag
Parent article: C library system-call wrappers, or the lack thereof

It's been running nonstop for me without incident for many years (I use it to reduce the overhead of a big /etc/services so I only need to parse it once).

It is clearly not unreliable for many people, given that glibc upstream has been talking about replacing nss with nscd by default for some time now.

I think you need to investigate more....


to post comments

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 12:53 UTC (Wed) by smurf (subscriber, #17840) [Link] (6 responses)

It's been flaky in the past. I wouldn't use the nscd from 199x in any kind of production environment.

Today? no problem IMHO, and it does speed things up (a lot, for some installations).

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 15:25 UTC (Wed) by zdzichu (subscriber, #17118) [Link] (3 responses)

Except when it doesn't work, which is a daily occurrence:

https://github.com/systemd/systemd/issues/10740

When allocating a dynamic user, a lookup is done in systemd, which fails (because the user doesnt exist, and systemd is going to allocate a dynamic uid for it) but then that answer is cached and after the dynamic user is set up, nscd will still say the user isn't created.

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 16:40 UTC (Wed) by nybble41 (subscriber, #55106) [Link]

You can disable caching for some or all services in /etc/nscd.conf.

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 19:01 UTC (Wed) by quotemstr (subscriber, #45331) [Link]

That's just an argument for moving nscd functionality into systemd. It's a coordination problem, not a conceptual problem with the protocol.

C library system-call wrappers, or the lack thereof

Posted Nov 15, 2018 16:05 UTC (Thu) by nix (subscriber, #2304) [Link]

systemd should flush the nscd cache when necessary (via nscd -i) if DynamicUser= is in use. This is not exactly subtle: it's half the contents of the nscd manpage in the man-pages package. :)

C library system-call wrappers, or the lack thereof

Posted Nov 14, 2018 17:05 UTC (Wed) by drag (guest, #31333) [Link] (1 responses)

I would rather just use sssd then any variant of nscd.

C library system-call wrappers, or the lack thereof

Posted Nov 15, 2018 16:07 UTC (Thu) by nix (subscriber, #2304) [Link]

nscd has one advantage which I don't know if sssd replicates: efficiency. Programs can query the cached names without actually talking to nscd at all, because it exports an mmapped region which programs can just read from as needed. Zero context switches! :)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds