Displaying 1 result from an estimated 1 matches for "sleeppid".
Did you mean:
sleepfit
2020 Oct 21
0
[PATCH nbdkit] New filter: exitwhen: exit gracefully when an event occurs.
...+# SUCH DAMAGE.
+
+source ./functions.sh
+set -x
+
+requires_filter exitwhen
+requires nbdsh --version
+
+sock=$(mktemp -u /tmp/nbdkit-test-sock.XXXXXX)
+pidfile=exitwhen-process-exits.pid
+files="$pidfile $sock"
+cleanup_fn rm -f $files
+
+# Start the unrelated process.
+sleep 1h &
+sleeppid=$!
+
+# Start nbdkit with the exitwhen filter.
+start_nbdkit -P $pidfile -U $sock \
+ --filter=exitwhen memory size=1M \
+ exit-when-process-exits=$sleeppid \
+ exit-when-poll=1
+
+# Killing the sleep process should cause nbdkit to exit after a few
+# seconds.
+k...