mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
daemon: Don't call a normal exit from the monitor a "crash".
When the monitored child is killed with SIGTERM, the monitoring process currently logs a message like "1 crashes: pid 12345 died, killed by signal 15 (Terminated), exiting". This counts the SIGTERM as a crash, even though it's intentional. This commit changes the log message to omit the "%d crashes" part on normal termination.
This commit is contained in:
16
lib/daemon.c
16
lib/daemon.c
@@ -367,13 +367,13 @@ monitor_daemon(pid_t daemon_pid)
|
||||
ovs_fatal(errno, "waitpid failed");
|
||||
} else if (retval == daemon_pid) {
|
||||
char *s = process_status_msg(status);
|
||||
free(status_msg);
|
||||
status_msg = xasprintf("%d crashes: pid %lu died, %s",
|
||||
++crashes,
|
||||
(unsigned long int) daemon_pid, s);
|
||||
free(s);
|
||||
|
||||
if (should_restart(status)) {
|
||||
free(status_msg);
|
||||
status_msg = xasprintf("%d crashes: pid %lu died, %s",
|
||||
++crashes,
|
||||
(unsigned long int) daemon_pid, s);
|
||||
free(s);
|
||||
|
||||
if (WCOREDUMP(status)) {
|
||||
/* Disable further core dumps to save disk space. */
|
||||
struct rlimit r;
|
||||
@@ -407,7 +407,9 @@ monitor_daemon(pid_t daemon_pid)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
VLOG_INFO("%s, exiting", status_msg);
|
||||
VLOG_INFO("pid %lu died, %s, exiting",
|
||||
(unsigned long int) daemon_pid, s);
|
||||
free(s);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user