6 * daemonize - routine to turn a process into a well-behaved daemon.
8 * Daemons should detach themselves thoroughly from the process which launched
9 * them, and not prevent any filesystems from being unmounted. daemonize()
10 * helps with the process.
13 * #include <ccan/daemonize/daemonize.h>
14 * #include <ccan/str/str.h>
19 * static void usage(const char *name)
21 * errx(1, "Usage: %s [--daemonize]\n", name);
24 * // Wait for a minute, possibly as a daemon.
25 * int main(int argc, char *argv[])
28 * if (argc == 2 && streq(argv[1], "--daemonize")) {
30 * err(1, "Failed to become daemon");
40 int main(int argc, char *argv[])
45 if (strcmp(argv[1], "depends") == 0) {
49 if (strcmp(argv[1], "libs") == 0) {