sesman: don't spit on the console when starting

As the Debian patch[1] expresses, spitting messages on the console when
a process starts in background is a bad idea. Everything should be
written to log file and daemon should start silently. This is a first
step to shut up daemons.

Got some idea from Debian Remote Maintainers and Thorsten Glaser,
thanks!

[1] 2751ad4d62/debian/patches/shutup-daemon.diff
This commit is contained in:
Koichiro IWAO 2018-05-30 04:10:06 +09:00
parent 19fa26a27e
commit 6ae3052a0f
No known key found for this signature in database
GPG Key ID: 9F72CDBC01BF10EB

View File

@ -209,8 +209,7 @@ main(int argc, char **argv)
if (1 == argc) if (1 == argc)
{ {
/* no options on command line. normal startup */ /* start in daemon mode if no cli options */
g_printf("starting sesman...\n");
daemon = 1; daemon = 1;
} }
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--nodaemon")) || else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--nodaemon")) ||
@ -312,6 +311,12 @@ main(int argc, char **argv)
g_exit(1); g_exit(1);
} }
/* not to spit on the console, show config summary only when running in foreground */
if (!daemon)
{
config_dump(g_cfg);
}
g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH);
/* starting logging subsystem */ /* starting logging subsystem */