diff options
author | 2016-09-28 17:05:17 -0500 | |
---|---|---|
committer | 2016-09-28 17:05:17 -0500 | |
commit | eead8a505245a292c43f070c0e836cdfeb7bd7bd (patch) | |
tree | 3d82674f80764011611e5d2e44c942d1b7a3991e | |
parent | befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae (diff) | |
download | pseudo-eead8a505245a292c43f070c0e836cdfeb7bd7bd.tar.gz pseudo-eead8a505245a292c43f070c0e836cdfeb7bd7bd.tar.bz2 pseudo-eead8a505245a292c43f070c0e836cdfeb7bd7bd.zip |
Quiet diagnostics during startup for pseudo -d
When the client spawns a pseudo server, it starts out sending diagnostics
to stderr. This can be spammy in some cases with races during startup;
everything resolves, but we get scary-looking diagnostics. So shove
those into a log file.
Signed-off-by: Seebs <seebs@seebs.net>
-rw-r--r-- | ChangeLog.txt | 5 | ||||
-rw-r--r-- | pseudo_server.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index f746c18..1ae6abd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,8 @@ +2016-09-28: + * (seebs) Send errors to log when daemonizing, but do that a lot + sooner to prevent startup messages which can show up spuriously + with multiple clients. + 2016-09-22: * (seebs) don't send SIGUSR1 to init. diff --git a/pseudo_server.c b/pseudo_server.c index 8731d20..7c2db2f 100644 --- a/pseudo_server.c +++ b/pseudo_server.c @@ -162,6 +162,9 @@ pseudo_server_start(int daemonize) { * SIGUSR1, or until too much time has passed. */ if (daemonize) { int child; + + /* make startup messages go away when invoked-as-daemon */ + pseudo_debug_logfile(PSEUDO_LOGFILE, 2); child = fork(); if (child == -1) { pseudo_diag("Couldn't fork child process: %s\n", @@ -231,7 +234,6 @@ pseudo_server_start(int daemonize) { setsid(); fclose(stdin); fclose(stdout); - pseudo_debug_logfile(PSEUDO_LOGFILE, 2); /* and then just execute the server code normally. */ /* Any logging will presumably go to logfile, but * exit status will make it back to the parent for |