mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18:06 +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");
|
ovs_fatal(errno, "waitpid failed");
|
||||||
} else if (retval == daemon_pid) {
|
} else if (retval == daemon_pid) {
|
||||||
char *s = process_status_msg(status);
|
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)) {
|
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)) {
|
if (WCOREDUMP(status)) {
|
||||||
/* Disable further core dumps to save disk space. */
|
/* Disable further core dumps to save disk space. */
|
||||||
struct rlimit r;
|
struct rlimit r;
|
||||||
@@ -407,7 +407,9 @@ monitor_daemon(pid_t daemon_pid)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
VLOG_INFO("%s, exiting", status_msg);
|
VLOG_INFO("pid %lu died, %s, exiting",
|
||||||
|
(unsigned long int) daemon_pid, s);
|
||||||
|
free(s);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user