X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/blobdiff_plain/a60a491c3ee0f67b022c822174590e67afa84e1a..4fdbb0ecdb72ec4d958ea212cd6453814e15a2d5:/fwp/mngr/fwp_mngr.c diff --git a/fwp/mngr/fwp_mngr.c b/fwp/mngr/fwp_mngr.c index aa2d850..233215d 100644 --- a/fwp/mngr/fwp_mngr.c +++ b/fwp/mngr/fwp_mngr.c @@ -123,13 +123,19 @@ int main(int argc, char *argv[]) int ret; forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fwp" }; int opt; + bool opt_daemon = false; + char *opt_pidfile = NULL; if (getenv("FWP_BYPASS")) priv.bypass = true; - while ((opt = getopt_long(argc, argv, "b:l:os", &long_opts[0], NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "b:l:hos", &long_opts[0], NULL)) != EOF) { switch (opt) { + case 'd': + opt_daemon = true; + opt_pidfile = optarg; + break; case 'l': ul_log_domain_arg2levels(optarg); break; @@ -149,6 +155,9 @@ int main(int argc, char *argv[]) } } + if (opt_daemon) + forb_daemon_prepare(opt_pidfile); + orb = forb_init(&argc, &argv, &attr); if (!orb) error(1, errno, "forb_init");