From: Michal Sojka Date: Fri, 21 Jan 2011 20:24:52 +0000 (+0100) Subject: Merge branch 'master' of git://frsh-forb.git.sourceforge.net/gitroot/frsh-forb/frsh X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/frsh.git/commitdiff_plain/3d8b226fce42630a1d0ee32917f0ab54fcfc30ee?hp=3ae9a74ff0baa1164d8e109d6b141f93b196c65f Merge branch 'master' of git://frsh-forb.git.sourceforge.net/gitroot/frsh-forb/frsh --- diff --git a/fres/cbroker/fcb.c b/fres/cbroker/fcb.c index b63e014..64180f0 100644 --- a/fres/cbroker/fcb.c +++ b/fres/cbroker/fcb.c @@ -1507,7 +1507,7 @@ int main(int argc, char *argv[]) }; int opt; - while ((opt = getopt_long(argc, argv, "d::l:", &long_opts[0], NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) { switch (opt) { case 'l': if (*optarg == '?') { diff --git a/resources/cpu_aquosa/mngr/frm_aqcpu.c b/resources/cpu_aquosa/mngr/frm_aqcpu.c index fe65759..381ad70 100644 --- a/resources/cpu_aquosa/mngr/frm_aqcpu.c +++ b/resources/cpu_aquosa/mngr/frm_aqcpu.c @@ -116,6 +116,7 @@ static void usage(void) { printf("usage: frm_aqcpu [ options ]\n"); + printf(" -d, --daemon [pid-file] go to background after FORB initialization\n"); printf(" -l, --loglevel |=,...\n"); } @@ -125,11 +126,17 @@ int main(int argc, char *argv[]) int ret; forb_init_attr_t attr = { .orb_id = "org.frescor.frm.aqcpu" }; int opt; + bool opt_daemon = false; + char *opt_pidfile = NULL; ul_logreg_domain(&ulogd_frm_aqcpu); - while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) { switch (opt) { + case 'd': + opt_daemon = true; + opt_pidfile = optarg; + break; case 'l': ul_log_domain_arg2levels(optarg); break; @@ -140,6 +147,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"); diff --git a/resources/cpucg/mngr/frm_cgcpu.c b/resources/cpucg/mngr/frm_cgcpu.c index 57d0119..f9c288b 100644 --- a/resources/cpucg/mngr/frm_cgcpu.c +++ b/resources/cpucg/mngr/frm_cgcpu.c @@ -134,11 +134,17 @@ int main(int argc, char *argv[]) int ret; int opt; forb_init_attr_t attr = { .orb_id = "org.frescor.frm.cgcpu" }; + bool opt_daemon = false; + char *opt_pidfile = NULL; ul_logreg_domain(&ulogd_frm_cpucg); - while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) { + while ((opt = getopt_long(argc, argv, "d::hl:", &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");