Displaying 2 results from an estimated 2 matches for "event_process_exits".
2020 Oct 20
1
[PATCH nbdkit INCOMPLETE] New filter: exitwhen: exit gracefully when an event occurs.
This incomplete patch adds a new filter allowing more control over
when nbdkit exits. You can now get nbdkit to exit gracefully on
certain events, such as a file being created, a pipe held open by
another process going away, or when another PID exits. There is also
a script option to allow for completely custom events.
It is untested at the moment, I'm posting it to get feedback on the
2020 Oct 21
0
[PATCH nbdkit] New filter: exitwhen: exit gracefully when an event occurs.
...ot;
+
+static unsigned pollsecs = 60;
+
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+static unsigned connections = 0;
+static bool exiting = false;
+
+/* The list of events generated from command line parameters. */
+struct event {
+ enum { EVENT_FILE_CREATED = 1, EVENT_FILE_DELETED, EVENT_PROCESS_EXITS,
+ EVENT_FD_CLOSED, EVENT_SCRIPT } type;
+ union {
+ char *filename; /* Filename or script. */
+ int fd; /* For PROCESS_EXITS or FD_CLOSED. */
+#ifndef __linux__
+ pid_t pid; /* For PROCESS_EXITS on non-Linux. */
+#endif
+ } u;
+};...