aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_util.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2016-03-02 14:04:24 -0600
committerPeter Seebach <peter.seebach@windriver.com>2016-03-02 14:07:46 -0600
commit529f667d444a15aabaa80a9412f27559ddc6408b (patch)
treed5af61dda5b5d244d436d62876ecffff57940bb4 /pseudo_util.c
parent77ee254a6c974aad9bcab2c58c9ee9e0880c9718 (diff)
downloadpseudo-529f667d444a15aabaa80a9412f27559ddc6408b.tar.gz
pseudo-529f667d444a15aabaa80a9412f27559ddc6408b.tar.bz2
pseudo-529f667d444a15aabaa80a9412f27559ddc6408b.zip
Server launch rework continued, probably finished
Server process now waits for its forked child when daemonizing, allowing us to yield meaningful exit status. Lock is now taken by the child, since it has a way to tell the parent about the exit status. (We send SIGUSR1 to the server to cause the wait loop to stop when the client is ready to go.) This allows us to switch to fcntl locking, which should in theory allow us to run with the pseudo directory NFS-mounted. Woot! Also mark a couple of overly spammy messages as PDBGF_VERBOSE to reduce the volume of uninteresting dup spam when looking at client behaviors. Client now uses execve to spawn server to work around a very strange behavior of unsetenv. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'pseudo_util.c')
-rw-r--r--pseudo_util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pseudo_util.c b/pseudo_util.c
index 6e6345f..be07951 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -588,9 +588,14 @@ pseudo_evlog_internal(char *fmt, ...) {
/* store pid in text form for prepending to messages */
void
pseudo_new_pid() {
+#if PSEUDO_PORT_LINUX
+ extern char *program_invocation_short_name; /* glibcism */
+#else
+ char *program_invocation_short_name = "unknown";
+#endif
int pid = getpid();
pid_len = snprintf(pid_text, 32, "%d: ", pid);
- pseudo_debug(PDBGF_PID, "new pid: %d\n", pid);
+ pseudo_debug(PDBGF_PID, "new pid: %d [%s]\n", pid, program_invocation_short_name);
}
/* helper function for pseudo_fix_path
@@ -823,7 +828,6 @@ void pseudo_dropenv() {
pseudo_diag("fatal: can't allocate new %s variable.\n", PRELINK_LIBRARIES);
}
if (ld_preload && strlen(ld_preload)) {
- pseudo_diag("ld_preload without: <%s>\n", ld_preload);
setenv(PRELINK_LIBRARIES, ld_preload, 1);
} else {
unsetenv(PRELINK_LIBRARIES);