This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] nscd: Improved support for tracking startup failure in nscd service (#16639)
- From: Russ Allbery <eagle at eyrie dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 28 Feb 2014 10:49:22 -0800
- Subject: Re: [PATCH 1/2] nscd: Improved support for tracking startup failure in nscd service (#16639)
- Authentication-results: sourceware.org; auth=none
- References: <20140228114545 dot GA11132 at spoyarek dot pnq dot redhat dot com>
Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> Currently, the nscd parent process parses commandline options and
> configuration, forks on startup and immediately exits with a success.
> If the child process encounters some error after this, it goes
> undetected and any services started up after it may have to repeatedly
> check to make sure that the nscd service did actually start up and is
> serving requests.
> To make this process more reliable, I have added a pipe between the
> parent and child process, through which the child process sends a
> notification to the parent informing it of its status. The parent
> waits for this status and once it receives it, exits with the
> corresponding exit code. So if the child service sends a success
> status (0), the parent exits with a success status. Similarly for
> error conditions, the child sends the non-zero status code, which the
> parent passes on as the exit code.
> This, along with setting the nscd service type to forking in its
> systemd configuration file, allows systemd to be certain that the nscd
> service is ready and is accepting connections.
> Tested on Fedora by doing the following:
> - Removing the 'nscd' user from /etc/passwd, which results in failure
> in the child. This used to be ignored by the forking parent, but is
> now caught and reported.
> - Added code in the child to segfault at the end of nscd_init. This
> was not detected earlier, but is now caught and reported.
Not being a glibc developer, I obviously can't do a formal review, but for
the record I read through this and it looks right to me. Thank you very
much for working on this, Siddhesh!
--
Russ Allbery (eagle@eyrie.org) <http://www.eyrie.org/~eagle/>