The easiest patch would be to implement this behaviour for soft
reconfig. :) But that is not backward-compatible and might break
something for somebody. I'm also working on implementing it as
additional option.
On Mon, Dec 3, 2018 at 2:51 PM Thomás S. Bregolin <[email protected]> wrote:
>
> Hello,
>
> On Wed, Nov 28, 2018, 16:34 Alexander Zubkov <[email protected] wrote:
>>
>> Hello,
>>
>> I have received no feedback on this suggestion and suppose it got
>> lost. I would be glad to hear some comments about this improvement.
>> On Fri, Nov 16, 2018 at 4:36 PM Alexander Zubkov <[email protected]> wrote:
>> >
>> > Hello.
>> >
>> > I have created a patch (attached) with new protocol option: disabled
>> > keep on|off. To keep the protocol's state while loading new config. It
>> > is useful when protocols disabled manually in the runtime, but we want
>> > to keep that state when loading new config. Patch is attached. I have
>> > made it against the current int-new branch.
>
>
> I will second this would be nice to have. I use bird with protocols set to
> disabled to keep them from coming up at the same time as the daemon, and have
> actually resorted to a wrapper that changes the configuration file in-place
> to "disabled no" before doing soft reconfiguration, and then back to "yes".
>
> Regards,
>
> Thomás
>
diff --git a/nest/proto.c b/nest/proto.c
index 3dcb342..89fe8a5 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -913,6 +913,13 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty
nc = sym->def;
nc->proto = p;
+ /* Keep protocol state during soft config */
+ if (type == RECONFIG_SOFT && (p->disabled != nc->disabled))
+ {
+ log(L_INFO "Keeping state of protocol %s", p->name);
+ nc->disabled = p->disabled;
+ }
+
/* We will try to reconfigure protocol p */
if (! force_reconfig && proto_reconfigure(p, oc, nc, type))
continue;