| Re: [chrony-dev] [PATCH] Add -N option for s6-style service readiness notification |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: Emery Hemingway <emery@xxxxxxxxxxxxxxxx>
- Subject: Re: [chrony-dev] [PATCH] Add -N option for s6-style service readiness notification
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Thu, 9 Apr 2026 14:15:41 +0200
- Cc: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775736947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MgfiCNRep+KvV1Vwh/VP3H4arE5b1ciXvkAa9O1YclM=; b=ZYFXERDpgNpeEVc/AGGwKOwFq1JlsSp65y0A91qrnroQczh97KE/YZjmVGf56qCoch6T/G Ii+T5JnXgLmsUvP3AbDInBZHLG/iBeyaMhfC72QzOaXSD+rQ0b6j4G68LE6opu38UyiNfd ayXYuPeQV+xcj4sQsA8H/IzB8XO+Ivc=
On Thu, Apr 09, 2026 at 11:15:35AM +0000, Emery Hemingway wrote:
> https://skarnet.org/software/s6/notifywhenup.html
Can you please describe it in a sentence how the notification works,
or copy the description from the man page?
> --- a/doc/chronyd.adoc
> +++ b/doc/chronyd.adoc
> @@ -201,6 +201,10 @@ still track its offset and frequency relative to the estimated true time. This
> option allows *chronyd* to be started without the capability to adjust or set
> the system clock (e.g. in some containers) to operate as an NTP server.
>
> +*-N* _fd_::
> +This options declares a file-descriptor that a process supervisor is reading
> +for an s6-style service ready notification.
There should be no hyphen in "file-descriptor"?
> @@ -110,6 +112,11 @@ delete_pidfile(void)
> static void
> notify_system_manager(int start)
> {
> + if (start && notify_fd) {
> + dprintf(notify_fd, "\n");
> + close(notify_fd);
> + }
dprintf() doesn't seem portable. write() would be better.
> +
> #ifdef LINUX
> /* The systemd protocol is documented in the sd_notify(3) man page */
> const char *message, *path = getenv("NOTIFY_SOCKET");
> @@ -454,6 +461,7 @@ print_help(const char *progname)
> " -P PRIORITY\tSet process priority (0)\n"
> " -m\t\tLock memory\n"
> " -x\t\tDon't control clock\n"
> + " -N FD\tnotify supervisor on an open file-descriptor\n"
I would prefer shorter "Notify supervisor" here. More details are in
the man page.
> " -v, --version\tPrint version and exit\n"
> " -h, --help\tPrint usage and exit\n",
> progname, DEFAULT_CONF_FILE, DEFAULT_USER);
> @@ -512,7 +520,7 @@ int main
> optind = 1;
>
> /* Parse short command-line options */
> - while ((opt = getopt(argc, argv, "46df:F:hl:L:mnpP:qQrRst:u:Uvx")) != -1) {
> + while ((opt = getopt(argc, argv, "46df:F:hl:L:mn:N:pP:qQrRst:u:Uvx")) != -1) {
This changes 'n' to accept an argument (extra colon).
Thanks,
--
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.