Re: [chrony-dev] Re: [PATCH] Add -N option for s6-style service readiness notification

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Apr 09, 2026 at 12:48:08PM +0000, Emery Hemingway wrote:
> In this notification scheme a service supervisor creates a pipe
> and passes the write file descriptor to chrony. When chronyd is
> initialised it writes a newline to the descriptor and the
> supervisor is informed that chronyd has successfully started and
> is in a ready state.

That looks better, thanks.

> +*-N* _fd_::
> +This option specifies a file descriptor that *chronyd* will write a newline
> +to after it is fully initialised. This is to notify a service supervisor that
> +*chronyd* is in a ready state.

After testing the code, I think this should also mention that it needs
to be combined with -n or -d.

>  static void
>  notify_system_manager(int start)
>  {

It would be nice to have a "s6-style service readiness notification"
comment here.

> +  if (start && notify_fd) {
> +    write(notify_fd, "\n", 1);
> +    close(notify_fd);
> +  }

My compiler is complaining about unchecked return value from write().
Ideally there should be a fatal log message, e.g. "Could not send
notification to descriptor %d".

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/