logging-enhancements-20011009
authorJeffrey Hutzelman <jhutz@cmu.edu>
Tue, 9 Oct 2001 06:27:31 +0000 (06:27 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 9 Oct 2001 06:27:31 +0000 (06:27 +0000)
The bosserver now logs the exit status of processes under its control.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

Messages generated as the result of assertion failures now include
timestamps.

src/bozo/bnode.c
src/util/assert.c

index b52f566..b401b46 100644 (file)
@@ -528,6 +528,12 @@ static int bproc() {
                            RememberProcName(tp);
                            tb->errorSignal = 0;
                        }
+                       if (tp->coreName)
+                           bozo_Log("%s:%s exited with code %d",
+                               tb->name, tp->coreName, tp->lastExit);
+                       else
+                           bozo_Log("%s exited with code %d",
+                               tb->name, tp->lastExit);
                    }
                    else {
                        /* Signal occurred, perhaps spurious due to shutdown request.
@@ -542,6 +548,14 @@ static int bproc() {
                            tb->lastErrorExit = FT_ApproxTime();
                            RememberProcName(tp);
                        }
+                       if (tp->coreName)
+                           bozo_Log("%s:%s exited on signal %d%s",
+                               tb->name, tp->coreName, tp->lastSignal,
+                               WCOREDUMP(status) ? " (core dumped)" : "");
+                       else
+                           bozo_Log("%s exited on signal %d%s",
+                               tb->name, tp->lastSignal,
+                               WCOREDUMP(status) ? " (core dumped)" : "");
                        SaveCore(tb, tp);
                    }
                    tb->lastAnyExit = FT_ApproxTime();
index ca35cc2..b144466 100644 (file)
@@ -26,7 +26,14 @@ void afs_NTAbort(void)
 
 void AssertionFailed(char *file, int line)
 {
-    fprintf(stderr, "Assertion failed! file %s, line %d.\n", file, line);
+    char tdate[26];
+    time_t when;
+
+    time(&when);
+    strcpy(tdate, ctime(&when));
+    tdate[24] = '0';
+    fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
+       tdate, file, line);
     fflush(stderr);
 #ifdef AFS_NT40_ENV
     afs_NTAbort();