/* command line options */
char *opt_output_path;
-static int opt_daemon;
+static int opt_daemon, opt_background;
static struct lttng_uri *control_uri;
static struct lttng_uri *data_uri;
static struct lttng_uri *live_uri;
fprintf(stderr, "Usage: %s OPTIONS\n\nOptions:\n", progname);
fprintf(stderr, " -h, --help Display this usage.\n");
fprintf(stderr, " -d, --daemonize Start as a daemon.\n");
+ fprintf(stderr, " -b, --background Start as a daemon, keeping console open.\n");
fprintf(stderr, " -C, --control-port URL Control port listening.\n");
fprintf(stderr, " -D, --data-port URL Data port listening.\n");
fprintf(stderr, " -L, --live-port URL Live view port listening.\n");
}
/* Daemonize */
- if (opt_daemon) {
- ret = daemon(0, 0);
+ if (opt_daemon || opt_background) {
+ ret = daemon(0, opt_background);
if (ret < 0) {
PERROR("daemon");
goto exit;