From a3cdeecf0033919e3b5a79c17c19b5ac98719256 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Mon, 20 Jul 2015 20:20:54 +0000
Subject: - Add timeout-finish support and "down-readiness" - LOTS of
refactoring to make this work - Remove s6-notifywhenup - s6-supervise now
rocks the casbah - rc for 2.2.0.0
---
INSTALL | 2 +-
doc/index.html | 6 +-
doc/notifywhenup.html | 6 +-
doc/s6-notifywhenup.html | 111 -------------------
doc/s6-sudod.html | 13 ++-
doc/s6-supervise.html | 22 ++--
doc/s6-svc.html | 28 +++--
doc/s6-svlisten.html | 8 +-
doc/s6-svlisten1.html | 5 +-
doc/s6-svstat.html | 6 +-
doc/s6-svwait.html | 10 +-
doc/servicedir.html | 6 ++
doc/upgrade.html | 21 ++++
package/deps.mak | 25 +++--
package/info | 2 +-
package/modes | 1 -
package/targets.mak | 1 -
src/include/s6/s6-supervise.h | 23 ++--
src/libs6/deps-lib/s6 | 1 +
src/libs6/s6_svc_writectl.c | 16 +++
src/libs6/s6_svstatus_pack.c | 15 ++-
src/libs6/s6_svstatus_unpack.c | 37 +++----
src/supervision/deps-exe/s6-notifywhenup | 3 -
src/supervision/deps-exe/s6-svlisten | 2 +
src/supervision/deps-exe/s6-svlisten1 | 2 +
src/supervision/deps-exe/s6-svwait | 1 +
src/supervision/s6-notifywhenup.c | 99 -----------------
src/supervision/s6-supervise.c | 155 ++++++++++++++-------------
src/supervision/s6-svc.c | 27 +++--
src/supervision/s6-svlisten.c | 114 +++-----------------
src/supervision/s6-svlisten.h | 29 +++++
src/supervision/s6-svlisten1.c | 102 +++---------------
src/supervision/s6-svscanctl.c | 12 +--
src/supervision/s6-svstat.c | 31 ++----
src/supervision/s6-svwait.c | 92 +++-------------
src/supervision/s6_svlisten_loop.c | 78 ++++++++++++++
src/supervision/s6_svlisten_signal_handler.c | 29 +++++
37 files changed, 454 insertions(+), 687 deletions(-)
delete mode 100644 doc/s6-notifywhenup.html
create mode 100644 src/libs6/s6_svc_writectl.c
delete mode 100644 src/supervision/deps-exe/s6-notifywhenup
delete mode 100644 src/supervision/s6-notifywhenup.c
create mode 100644 src/supervision/s6-svlisten.h
create mode 100644 src/supervision/s6_svlisten_loop.c
create mode 100644 src/supervision/s6_svlisten_signal_handler.c
diff --git a/INSTALL b/INSTALL
index 684b138..97cf65a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,7 +6,7 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 4.0 or later
- - skalibs version 2.3.5.1 or later: http://skarnet.org/software/skalibs/
+ - skalibs version 2.3.6.0 or later: http://skarnet.org/software/skalibs/
- execline version 2.1.2.2 or later: http://skarnet.org/software/execline/
This software will run on any operating system that implements
diff --git a/doc/index.html b/doc/index.html
index 87fe66b..0c23ff0 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -84,7 +84,7 @@ with s6
GNU make, version 4.0 or later. Please be aware that s6 will not build
with an earlier version.
skalibs version
-2.3.5.1 or later. It's a build-time requirement. It's also a run-time
+2.3.6.0 or later. It's a build-time requirement. It's also a run-time
requirement if you link against the shared version of the skalibs
library.
execline version
@@ -101,7 +101,7 @@ library.
Download
Daemontools-like utilities
diff --git a/doc/notifywhenup.html b/doc/notifywhenup.html
index 9a288ac..6bc8b99 100644
--- a/doc/notifywhenup.html
+++ b/doc/notifywhenup.html
@@ -67,16 +67,16 @@ a generic mechanism that some daemons already implement.
service directory for the daemon contains
a valid notification-fd file, the daemon's supervisor, i.e. the
s6-supervise program, will properly catch
-the daemon's message, update a state file (supervise/ready), then
+the daemon's message, update the status file (supervise/status),
then notify all the subscribers
-with a 'U' event, meaning that the service is now up and ready.
+with a 'U' event, meaning that the service is now up and ready.
This method should really be implemented in every long-running
program providing a service. When it is not the case, it's impossible
to provide reliable startup notifications, and subscribers should then
-be content with the unreliable 'u' events provided by s6-supervise.
+be content with the unreliable 'u' events provided by s6-supervise.
-
-
-s6
-Software
-skarnet.org
-
-
- The s6-notifywhenup program
-
-
-
-Starting with s6-2.1.4.0, the s6-notifywhenup program has been deprecated,
-because there was still a case (albeit extremely rare) where a race
-condition would occur and readiness would be improperly advertised.
-Readiness notification for a service can now be achieved via a
-notification-fd file in the
-service directory, containing the
-number of the descriptor the service will write its readiness
-notification newline to. The notification will directly be picked by
-s6-supervise.
-
-
-
- Quick upgrade recipe: for every service using s6-notifywhenup,
-replace the s6-notifywhenup invocation in your run script with
-fdmove 1 3, then perform echo 3 > notification-fd.
-Done!
-
-
-
-
-s6-notifywhenup launches a daemon while listening to a file descriptor,
-and sends a 'U' event to a fifodir when it
-receives something on that file descriptor.
-
-
-
-This page explains why this program is
-needed.
-
-
- Interface
-
-
- s6-notifywhenup [ -d fd ] [ -e fifodir ] [ -f ] [ -X ] [ -t timeout ] prog...
-
-
-
- - s6-notifywhenup forks and executes prog... as the
-parent, with a pipe from prog...'s stdout to the child.
- - The child waits for a newline (\n) to be written
-on the pipe. When it gets it, it creates a
-./supervise/ready file then sends a 'U' event to the
-./event fifodir.
- - The child exits 0.
-
-
- Options
-
-
- - -d fd : listen to
-prog's output on descriptor fd. The default is 1.
- - -e fifodir : send a 'U' event to fifodir
-fifodir. Default is ./event.
- - -f : simple fork. Normally, s6-notifywhenup doubleforks,
-in order to accommodate for a
-prog that does not expect to have a child and avoid a
-pending zombie. This option avoids the doublefork, but it should only be
-set if prog reaps even children it doesn't know it has.
- - -t timeout : if no EOF has been received
-after timeout milliseconds, exit without sending the event.
-Default is 0, meaning infinite.
- - -X : fake readiness. s6-notifywhenup will actually send
-the newline itself before executing prog. This option should in
-principle never be used.
-
-
- Notes
-
-
- - s6-notifywhenup executes prog... as the parent in order
-for prog to keep the same pid, which is vital for supervised
-processes.
- - s6-notifywhenup can be used, for instance, with
-s6-ipcserver
-and its -1 option, so that reliable startup notification is
-achieved. s6-notifywhenup -f s6-ipcserver -1 args will
-send a 'U' event to ./event when s6-ipcserver is actually
-listening to its socket.
- - The s6-svwait program can be used
-to wait for 'U' events, as well as the
-s6-svlisten1 and
-s6-svlisten programs.
- - The supervise/ready file, when created, contains at least
-the absolute time when s6-notifywhenup detected service readiness. The
-format and contents of this file are subject to change.
-
-
-
diff --git a/doc/s6-notifywhenup.html b/doc/s6-notifywhenup.html
deleted file mode 100644
index cdfa693..0000000
--- a/doc/s6-notifywhenup.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-