[ovs-dev] [PATCH 2/7] daemon: Report number of crashes on monitor process command line.

Justin Pettit jpettit at nicira.com
Thu Sep 23 06:02:52 UTC 2010


This is good information to have.

--Justin


On Sep 22, 2010, at 4:45 PM, Ben Pfaff wrote:

> ---
> lib/daemon.c |    5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/daemon.c b/lib/daemon.c
> index 5486504..6b61879 100644
> --- a/lib/daemon.c
> +++ b/lib/daemon.c
> @@ -330,11 +330,13 @@ monitor_daemon(pid_t daemon_pid)
>     const char *saved_program_name;
>     time_t last_restart;
>     char *status_msg;
> +    int crashes;
> 
>     saved_program_name = program_name;
>     program_name = xasprintf("monitor(%s)", program_name);
>     status_msg = xstrdup("healthy");
>     last_restart = TIME_MIN;
> +    crashes = 0;
>     for (;;) {
>         int retval;
>         int status;
> @@ -352,7 +354,8 @@ monitor_daemon(pid_t daemon_pid)
>         } else if (retval == daemon_pid) {
>             char *s = process_status_msg(status);
>             free(status_msg);
> -            status_msg = xasprintf("pid %lu died, %s",
> +            status_msg = xasprintf("%d crashes: pid %lu died, %s",
> +                                   ++crashes,
>                                    (unsigned long int) daemon_pid, s);
>             free(s);
> 
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list