On 09/29/2016 01:59 PM, Robert Yang wrote:
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: Robert Yang
---
...t-diagnostics-during-startup-for-pseudo-d.patch | 54 ++
...er.c-add-prefix-for-log-and-make-log-cons.patch | 83 ++
Sorry, added an unused patch which had made by me, removed it from the repo.
// Robert
.../files/0002-Use-correct-file-descriptor.patch | 53 ++
meta/recipes-devtools/pseudo/pseudo_1.8.1.bb | 2 +
4 files changed, 192 insertions(+)
create mode 100644
meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
create mode 100644
meta/recipes-devtools/pseudo/files/0001-pseudo_server.c-add-prefix-for-log-and-make-log-cons.patch
create mode 100644
meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch
diff --git
a/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
b/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
new file mode 100644
index 000..d4b9f6a
--- /dev/null
+++
b/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
@@ -0,0 +1,54 @@
+From eead8a505245a292c43f070c0e836cdfeb7bd7bd Mon Sep 17 00:00:00 2001
+From: Seebs
+Date: Wed, 28 Sep 2016 17:05:17 -0500
+Subject: [PATCH 1/2] 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
+
+Upstream-Status: Backport
+Signed-off-by: Robert Yang
+---
+ ChangeLog.txt | 5 +
+ pseudo_server.c | 4 +++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index d6359ca..4cc24de 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-07-28:
+ * (seebs) Fix performance issue on deletion with xattr changes.
+
+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
diff --git
a/meta/recipes-devtools/pseudo/files/0001-pseudo_server.c-add-prefix-for-log-and-make-log-cons.patch
b/meta/recipes-devtools/pseudo/files/0001-pseudo_server.c-add-prefix-for-log-and-make-log-cons.patch
new file mode 100644
index 000..e9cf3ba
--- /dev/null
+++
b/meta/recipes-devtools/pseudo/files/0001-pseudo_server.c-add-prefix-for-log-and-make-log-cons.patch
@@ -0,0 +1,83 @@
+From 505ea70ff63da3645243a7f3e4359432b11c3dd9 Mon Sep 17 00:00:00 2001
+From: Robert Yang
+Date: Tue, 27 Sep 2016 19:39:03 -0700
+Subject: [PATCH] pseudo_server.c: add prefix for log and make log consistent
+
+The log messages might not be consistent when the same error happens,
+part of the log messages go to terminial, and part of them go to
+pseudo.log, and these code use multiprocesses, which makes it very hard
+to understand, for example:
+$ kill -9 `ps aux | grep /usr/bin/pseud | awk '{print $2}'`
+$ /path/to/usr/bin/pseudo & /path/to/usr/bin/pseudo
+
+Messages printed to terminal:
+ Child process exit status 4: lock_held
+Messages printed to pseudo.log:
+ pseudo: lock already held by existing pid 34028.
+ pseudo: Couldn't obtain lock: Resource temporarily unavailable.
+
+They are messages for one error, so that they should be consistent, this
+patch fixes the problem, they will go into pseudo.log now.
+
+This patch also adds log prefix "pseudo: "