Skip to content

alfred: Fix state handling for startup and restart/reload of alfred#643

Merged
simonwunderlich merged 2 commits into
openwrt:masterfrom
ecsv:batadv-2021.0
Feb 16, 2021
Merged

alfred: Fix state handling for startup and restart/reload of alfred#643
simonwunderlich merged 2 commits into
openwrt:masterfrom
ecsv:batadv-2021.0

Conversation

@ecsv

@ecsv ecsv commented Feb 15, 2021

Copy link
Copy Markdown
Contributor

@simonwunderlich


Alfred can be stopped during a (re)start or reload when:

  • disabled = 1
  • batman-adv interface is missing
  • MAC based EUI64 IPv6 link-local address not set

It is assumed that procd detects that the procd instance definition disappeared and the currently running instance must be stopped. But all these checks were triggering an "exit" which then stopped the alfred init script and the wrapper from /lib/functions/procd.sh. And thus procd was never informed about the instances which should be changed.

The correct handling is to return the result of the function instead of directly killing the init scripts.

Fixes: 45db0e6 ("alfred: use procd")


The alfred server always needs interfaces to operate on. But these interfaces might not exist at the moment when the daemon process is started. This situation stopped the startup process after the init scripts waited for a longer period of polling the system state.

But alfred is able to deal with interfaces which disappeared at runtime but existed at startup. To force a similar behavior for the alfred startup, the parameter "--force" or "-f" is used. The extra polling code is therefore no longer needed in the init scripts.

ecsv added 2 commits February 15, 2021 21:03
Alfred can be stopped during a (re)start or reload when:

* disabled = 1
* batman-adv interface is missing
* MAC based EUI64 IPv6 link-local address not set

It is assumed that procd detects that the procd instance definition
disappeared and the currently running instance must be stopped. But all
these checks were triggering an "exit" which then stopped the alfred init
script and the wrapper from /lib/functions/procd.sh. And thus procd was
never informed about the instances which should be changed.

The correct handling is to return the result of the function instead of
directly killing the init scripts.

Fixes: 45db0e6 ("alfred: use procd")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
The alfred server always needs interfaces to operate on. But these
interfaces might not exist at the moment when the daemon process is
started. This situation stopped the startup process after the init scripts
waited for a longer period of polling the system state.

But alfred is able to deal with interfaces which disappeared at runtime but
existed at startup. To force a similar behavior for the alfred startup, the
parameter "--force" or "-f" is used. The extra polling code is therefore no
longer needed in the init scripts.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
@simonwunderlich simonwunderlich merged commit d63eda0 into openwrt:master Feb 16, 2021
@ecsv ecsv deleted the batadv-2021.0 branch February 16, 2021 08:10
@adschm

adschm commented Feb 16, 2021

Copy link
Copy Markdown
Member

@simonwunderlich This is now missing in openwrt-21.02 branch, as this has been created slightly before your merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants