projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Generalize facet_put__() so that it is more useful.
[openvswitch]
/
lib
/
daemon.c
diff --git
a/lib/daemon.c
b/lib/daemon.c
index bc28973fc6a2d3d62c3aa7c270659387b8e3f0e1..c0f168291e6ed053540e9260ec8e6997d4b8d4a3 100644
(file)
--- a/
lib/daemon.c
+++ b/
lib/daemon.c
@@
-35,7
+35,7
@@
#include "util.h"
#include "vlog.h"
#include "util.h"
#include "vlog.h"
-VLOG_DEFINE_THIS_MODULE(daemon)
+VLOG_DEFINE_THIS_MODULE(daemon)
;
/* --detach: Should we run in the background? */
static bool detach;
/* --detach: Should we run in the background? */
static bool detach;
@@
-67,8
+67,8
@@
char *
make_pidfile_name(const char *name)
{
return (!name
make_pidfile_name(const char *name)
{
return (!name
- ? xasprintf("%s/%s.pid", ovs_rundir, program_name)
- : abs_file_name(ovs_rundir, name));
+ ? xasprintf("%s/%s.pid", ovs_rundir
()
, program_name)
+ : abs_file_name(ovs_rundir
()
, name));
}
/* Sets up a following call to daemonize() to create a pidfile named 'name'.
}
/* Sets up a following call to daemonize() to create a pidfile named 'name'.
@@
-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);
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)) {
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;
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 {
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);
}
}
exit(0);
}
}
@@
-498,7
+500,7
@@
daemon_usage(void)
" --pidfile[=FILE] create pidfile (default: %s/%s.pid)\n"
" --overwrite-pidfile with --pidfile, start even if already "
"running\n",
" --pidfile[=FILE] create pidfile (default: %s/%s.pid)\n"
" --overwrite-pidfile with --pidfile, start even if already "
"running\n",
- ovs_rundir, program_name);
+ ovs_rundir
()
, program_name);
}
/* Opens and reads a PID from 'pidfile'. Returns the nonnegative PID if
}
/* Opens and reads a PID from 'pidfile'. Returns the nonnegative PID if