struct iface *iface = &ifaces[i];
dhclient_init(iface->dhcp, 0);
}
- fatal_signal_add_hook(release_ifaces, NULL);
+ fatal_signal_add_hook(release_ifaces, NULL, true);
retval = regcomp(&accept_controller_regex, accept_controller_re,
REG_NOSUB | REG_EXTENDED);
fatal(retval, "Could not listen for vlog connections");
}
+ die_if_already_running();
+
signal(SIGPIPE, SIG_IGN);
for (;;) {
fatal_signal_block();
static bool
validate_dhcp_offer(const struct dhcp_msg *msg, void *aux)
{
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(60, 60);
char *vconn_name;
bool accept;
vconn_name = dhcp_msg_get_string(msg, DHCP_CODE_OFP_CONTROLLER_VCONN);
if (!vconn_name) {
- VLOG_WARN("rejecting DHCP offer missing controller vconn");
+ VLOG_WARN_RL(&rl, "rejecting DHCP offer missing controller vconn");
return false;
}
accept = !regexec(&accept_controller_regex, vconn_name, 0, NULL, 0);
{"no-detach", no_argument, 0, OPT_NO_DETACH},
{"timeout", required_argument, 0, 't'},
{"pidfile", optional_argument, 0, 'P'},
+ {"force", no_argument, 0, 'f'},
{"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
set_pidfile(optarg);
break;
+ case 'f':
+ ignore_existing_pidfile();
+ break;
+
case 't':
timeout = strtoul(optarg, NULL, 10);
if (timeout <= 0) {
"\nOther options:\n"
" -t, --timeout=SECS give up discovery after SECS seconds\n"
" -P, --pidfile[=FILE] create pidfile (default: %s/%s.pid)\n"
+ " -f, --force with -P, start even if already running\n"
" -v, --verbose=MODULE[:FACILITY[:LEVEL]] set logging levels\n"
" -v, --verbose set maximum verbosity level\n"
" -h, --help display this help message\n"