[Pkg-shadow-devel] [PATCH] nscd: ignore exit 1 code

Mike Frysinger vapier at gentoo.org
Fri Feb 17 22:48:42 UTC 2012


On Friday 17 February 2012 16:08:43 Nicolas François wrote:
> On Sun, Feb 12, 2012 at 11:45:40PM -0500, Mike wrote:
> > If nscd is installed but not in use, then running `nscd -i` will exit(1).
> > We shouldn't warn in this case since this is not abnormal behavior.
> 
> I checked the nscd (from glibc) source.
> This error status is not used exclusively when nscd is not in use.
> 
> This means other errors would not be caught.
> 
> Do you know any way to check if nscd is in use?

i don't think so :/

> One solution may be to check the existence of the PID file or socket.

pid file locations might be diff across distributions.  socket could exist, but 
not be in use.

> Another solution could be to document that nscd cache flushing is only
> performed as best effort, and ignore all failures from nscd (not only
> return code 1).

i think that's best.  after all, nscd can only be used with glibc, but you can 
use other caching daemons with glibc than just nscd.

only other option i can think of is to look at what was written to the pipe.  
if `nscd -i ...` exited *silently* with 1, then ignore it.  but if it wrote 
something to std{err,out}, then don't ignore the failure.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/attachments/20120217/005d9aff/attachment.pgp>


More information about the Pkg-shadow-devel mailing list