This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/4] Mark nscd service as forking in systemd service file (#16639)
- From: Rich Felker <dalias at aerifal dot cx>
- To: Russ Allbery <eagle at eyrie dot org>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 26 Feb 2014 19:46:03 -0500
- Subject: Re: [PATCH 4/4] Mark nscd service as forking in systemd service file (#16639)
- Authentication-results: sourceware.org; auth=none
- References: <20140226172242 dot GE6419 at spoyarek dot pnq dot redhat dot com> <20140226183950 dot GK184 at brightrain dot aerifal dot cx> <20140226185509 dot GG6419 at spoyarek dot pnq dot redhat dot com> <87a9ddwkyg dot fsf at windlord dot stanford dot edu>
On Wed, Feb 26, 2014 at 02:47:03PM -0800, Russ Allbery wrote:
> The best fix from a systemd perspective is to not use either of these
> service types and instead use Type=notify along with the sd_notify(3) API
> to clearly inform systemd when the daemon is actually ready to answer
> requests. This would produce the correct behavior in this case without
> requiring reverting the service type to the forking model. This is
> exactly the problem for which the sd_notify(3) interface was created.
This is rather hideous to ask daemons to link to some systemd library
and make a special function call to perform the notification. The
obvious correct way to do the notification is to have the daemon
inherit a file descriptor to a pipe, and write to and close it once
initialization is complete. (Contents written would not matter; the
idea is that an empty pipe, the default case on unexpected exit/close,
would indicate failure.)
Leave it to systemd to design something idiotically complicated that
forces everybody to link to their libs...
Rich