From: Philippe Proulx Date: Thu, 27 Aug 2015 15:52:33 +0000 (-0400) Subject: Daemonize sessiond on `lttng create` X-Git-Tag: v2.8.0-rc1~382 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=bbd44cae042d871887fb7207c5144f68d47cb3a8;hp=bbd44cae042d871887fb7207c5144f68d47cb3a8;p=lttng-tools.git Daemonize sessiond on `lttng create` Since the session daemon forked by `lttng create` shares its standard output/error FDs when not using `--daemonize`, redirecting the standard output/error of this command to another program "hangs" because the session daemon never terminates. Example that's not working (when sessiond is not running): lttng create | wc or: lttng 2>&1 | wc Using sessiond's `--daemonize` option makes it close its FDs. This option also ensures that when the sessiond process exits, it has forked itself as a daemon and is ready to accept commands. Therefore we don't need to catch SIGCHLD and SIGUSR1; just waitpid() on sessiond's PID and make sure it exited normally and with an exit status of 0 to continue. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau ---