/*** Main entry point ***/
static int debug;
+static int no_fork;
static struct opt_section options = {
OPT_ITEMS {
OPT_HELP("Options:"),
OPT_HELP_OPTION,
OPT_BOOL('d', "debug", debug, 0, "\tEnable debugging mode (no fork etc.)"),
+ OPT_BOOL(0, "no-fork", no_fork, 0, "\tDo not fork\n"),
OPT_END
}
};
unsetenv("HOME");
struct daemon_params dp = {
- .flags = (debug ? DAEMON_FLAG_SIMULATE : 0),
+ .flags = ((debug || no_fork) ? DAEMON_FLAG_SIMULATE : 0),
.pid_file = "/run/ursaryd.pid",
.run_as_user = "ursary",
};