1: emits the correct PID even if daemonized
2: run the startup calls before executing the client (if any)
Change-Id: I7e06961d4a88bc6083aa1bc48ccedf57b76ea268
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+ /* run the startup calls */
+ run_startup_calls();
+
/* run the command */
if (execute_command() < 0)
goto error;
/* ready */
sd_notify(1, "READY=1");
/* run the command */
if (execute_command() < 0)
goto error;
/* ready */
sd_notify(1, "READY=1");
-
- /* run the startup calls */
- run_startup_calls();
// ------------- Build session handler & init config -------
config = afb_config_parse_arguments(argc, argv);
// ------------- Build session handler & init config -------
config = afb_config_parse_arguments(argc, argv);
- INFO("running with pid %d", getpid());
// --------- run -----------
if (config->background) {
// --------- run -----------
if (config->background) {
// ---- in foreground mode --------------------
INFO("entering foreground mode");
}
// ---- in foreground mode --------------------
INFO("entering foreground mode");
}
+ INFO("running with pid %d", getpid());
/* set the daemon environment */
setup_daemon();
/* set the daemon environment */
setup_daemon();