From 48a5bb7a26de6c3bea32d18c3e476dd2cedbcfd3 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Tue, 11 Feb 2020 01:38:05 +0000
Subject: Add bcnm-waitif doc
---
doc/bcnm-waitif.html | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/index.html | 1 +
2 files changed, 88 insertions(+)
create mode 100644 doc/bcnm-waitif.html
diff --git a/doc/bcnm-waitif.html b/doc/bcnm-waitif.html
new file mode 100644
index 0000000..ac95397
--- /dev/null
+++ b/doc/bcnm-waitif.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+ bcnm: the bcnm-waitif program
+
+
+
+
+
+
+
+s6
+Software
+skarnet.org
+
+
+ The bcnm-waitif program
+
+
+bcnm-waitif waits until a set of network interfaces are in the desired state,
+or a timeout occurs. Then it exits. It is typically used to avoid race conditions
+in a service startup sequence.
+
+
+ Interface
+
+
+ bcnm-waitif [ -u | -d ] [ -t timeout ] [ -k kbufsize ] mask interface...
+
+
+
+ - bcnm-waitif reads the state of all the interfaces specified by
+name as the interface... arguments.
+ - If all the listed interfaces match the state defined in mask,
+it exits 0.
+ - Else, it waits for network interface state changes, and performs the
+check again.
+ - It loops until all the listed interfaces are in the desired state,
+or a timeout (if defined) occurs.
+
+
+ mask meaning
+
+
+ mask is an unsigned integer representing a bitmask for the
+flags to be tested. If several bits are given, the wanted state is the
+conjunction of these flags: the condition will be true if all
+those checks pass.
+
+
+
+ - 1: the interface exists (the kernel knows about it)
+ - 2: the interface is UP (the administrator has activated it)
+ - 4: the interface is RUNNING (functional, not unplugged)
+
+
+ Options
+
+
+ - -u : up. bcnm-waitif will wait until all
+the states defined in mask are reached by all the interfaces
+in interface.... This is the default.
+ - -d : down. bcnm-waitif will wait until
+none of the states defined in mask is true.
+ - -t timeout : if the desired state
+still has not been reached after timeout milliseconds,
+bcnm-waitif will exit 99 with an error message. The default
+is 0, meaning there is no timeout and the program can wait forever.
+ - -k kbufsize : use kbufsize
+bytes for the netlink socket buffer. Too small a buffer risks losing
+state change events and reporting incorrect results. Too large a buffer
+wastes memory. Default is 131072, which is probably on the large side.
+
+
+ Exit codes
+
+
+ - 0: success
+ - 99: timed out
+ - 100: wrong usage
+ - 111: system call failed
+
+
+
+
diff --git a/doc/index.html b/doc/index.html
index bfc9f6b..24904a7 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -91,6 +91,7 @@ the previous versions of bcnm and the current one.
Libraries
--
cgit v1.3.1