Skip to content

Commit

Permalink
daemon-unix: Use same name for original or restarted children.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
blp committed Sep 6, 2018
1 parent 715cc89 commit 1bc1377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/daemon-unix.c
Expand Up @@ -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
Expand Down

0 comments on commit 1bc1377

Please sign in to comment.