mirror of
https://github.com/troglobit/libite.git
synced 2026-10-21 11:19:38 +00:00
runbg: new helper function inspired by the Infix project
The runbg() function is a delayed execvp() that has double-forked to the background (to not create zombies). It is useful for running commands in the background for APIs that need to return a reply, e.g. a NETCONF RPC to reboot the system. Compared to the original in Infix, this version double forks to reparent itself to PID 1 (init), closes all open files, including stdio. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
921afdecb4
commit
92bb0ca399
7 files changed
+135
-3
No files matched your search
@@ -128,6 +128,7 @@ void *reallocarray(void *optr, size_t nmemb, size_t size);
|
||||
void progress (int percent, int max_width);
|
||||
void progress_simple(int percent);
|
||||
|
||||
int runbg (char *const cmd[], int delay);
|
||||
int systemf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
|
||||
sdbuf_t*telnet_open (int addr, short port);
|
||||
|
||||
Reference in new issue
Block a user