struct config *config, *new_config, *old_config, *future_config;
static event *config_event;
-int shutting_down;
+int shutting_down, future_type;
bird_clock_t boot_time;
/**
config = new_config = c;
if (old_config)
old_config->obstacle_count++;
+
DBG("sysdep_commit\n");
force_restart = sysdep_commit(c, old_config);
DBG("global_commit\n");
break;
c = future_config;
future_config = NULL;
- log(L_INFO "Switching to queued configuration...");
- if (!config_do_commit(c, RECONFIG_HARD))
+ log(L_INFO "Reconfiguring to queued configuration");
+ if (!config_do_commit(c, future_type))
break;
}
}
else
log(L_INFO "Queued new configuration");
future_config = c;
+ future_type = type;
return CONF_QUEUED;
}
+
+ if (!shutting_down)
+ log(L_INFO "Reconfiguring");
+
if (config_do_commit(c, type))
{
config_done(NULL);
if ((nc->protocol != oc->protocol) ||
(nc->disabled != oc->disabled) ||
(nc->table->table != oc->table->table) ||
- (proto_get_router_id(nc) == proto_get_router_id(oc)))
+ (proto_get_router_id(nc) != proto_get_router_id(oc)))
return 0;
int import_changed = (type != RECONFIG_SOFT) && ! filter_same(nc->in_filter, oc->in_filter);
p->in_filter = nc->in_filter;
p->out_filter = nc->out_filter;
+ if (import_changed || export_changed)
+ log(L_INFO "Reloading protocol %s", p->name);
+
if (import_changed && ! p->reload_routes(p))
{
/* Now, the protocol is reconfigured. But route reload failed
and we have to do regular protocol restart. */
+ log(L_INFO "Restarting protocol %s", p->name);
p->disabled = 1;
proto_rethink_goal(p);
p->disabled = 0;
continue;
/* Unsuccessful, we will restart it */
- DBG("\t%s: power cycling\n", oc->name);
+ if (!p->disabled && !nc->disabled)
+ log(L_INFO "Restarting protocol %s", p->name);
+ else if (p->disabled && !nc->disabled)
+ log(L_INFO "Enabling protocol %s", p->name);
+ else if (!p->disabled && nc->disabled)
+ log(L_INFO "Disabling protocol %s", p->name);
+
PD(p, "Restarting");
p->cf_new = nc;
}
else
{
- DBG("\t%s: deleting\n", oc->name);
+ if (!shutting_down)
+ log(L_INFO "Removing protocol %s", p->name);
PD(p, "Unconfigured");
p->cf_new = NULL;
}
WALK_LIST(nc, new->protos)
if (!nc->proto)
{
- DBG("\t%s: adding\n", nc->name);
+ if (old_config) /* Not a first-time configuration */
+ log(L_INFO "Adding protocol %s", nc->name);
proto_init(nc);
}
DBG("\tdone\n");
cli_msg(-8, "%s: already disabled", p->name);
else
{
- cli_msg(-9, "%s: disabled", p->name);
+ log(L_INFO "Disabling protocol %s", p->name);
p->disabled = 1;
proto_rethink_goal(p);
+ cli_msg(-9, "%s: disabled", p->name);
}
break;
cli_msg(-10, "%s: already enabled", p->name);
else
{
- cli_msg(-11, "%s: enabled", p->name);
+ log(L_INFO "Enabling protocol %s", p->name);
p->disabled = 0;
proto_rethink_goal(p);
+ cli_msg(-11, "%s: enabled", p->name);
}
break;
cli_msg(-8, "%s: already disabled", p->name);
else
{
+ log(L_INFO "Restarting protocol %s", p->name);
p->disabled = 1;
proto_rethink_goal(p);
p->disabled = 0;
if (p->proto_state != PS_UP)
break;
+ log(L_INFO "Reloading protocol %s", p->name);
+
/* re-importing routes */
if (xx != XX_RELOAD_OUT)
if (! (p->reload_routes && p->reload_routes(p)))