summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-09-06 10:44:47 -0700
committerBen Pfaff <blp@ovn.org>2018-09-06 11:03:34 -0700
commit1b48a61d9238f66896ee8eba3a7d86a1695a1efb (patch)
tree7a2414644386377a6f5443215341a95aedf53f62
parente3d9ff97d8004abd2b57e0819e67bfc5d0e0694c (diff)
downloadopenvswitch-1b48a61d9238f66896ee8eba3a7d86a1695a1efb.tar.gz
daemon-unix: Use same name for original or restarted children.
Linux has an idea of process name that is visible in /proc/$pid/comm. This is "ovs-vswitchd" for a freshly started ovs-vswitchd process. When the monitor code restarted a crash child, it changed it to the empty string. This confused the daemon_is_running check in ovs-lib.in, which checks comm. This commit fixes the problem by setting the program name as comm in newly restarted children. VMware-BZ: #2191724 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Gurucharan Shetty <guru@ovn.org>
-rw-r--r--lib/daemon-unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/daemon-unix.c b/lib/daemon-unix.c
index 2f5113689..259fe4382 100644
--- a/lib/daemon-unix.c
+++ b/lib/daemon-unix.c
@@ -428,7 +428,7 @@ monitor_daemon(pid_t daemon_pid)
/* Running in new daemon process. */
ovs_cmdl_proctitle_restore();
- set_subprogram_name("");
+ set_subprogram_name(program_name);
}
/* If daemonization is configured, then starts daemonization, by forking and