Commit Graph

14 Commits

Author SHA1 Message Date
Sven Eckelmann ad85bc8142 alfred: Start up alfred without valid interfaces
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>
2021-02-15 21:17:53 +01:00
Sven Eckelmann 993f03cecb alfred: Fix procd process handling for disable state
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: 45db0e60d2 ("alfred: use procd")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-02-15 21:03:57 +01:00
Sven Eckelmann cf802f8607 alfred: Allow startup without batman-adv sysfs support
The batman-adv kernel module can be build without sysfs support. This will
stop the kernel module from creating the "mesh" directory. The alfred init
script must not depend on this folder to start the daemon up.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 21:35:39 +02:00
Sven Eckelmann 157da8c4ee alfred: Support multiple listening interfaces
The alfred daemon allows to be started with multiple interfaces. The first
interface is used for communication and to calculate the source mac
address. The rest of the interfaces are only used for communication.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-08-01 21:34:44 +02:00
Adrian Schmutzler 52e2545198 alfred: Fix alfred.init
The commit 45db0e6 introduced curly brackets which are not correct
syntax and thus broke the script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-21 16:00:20 +02:00
Paul Spooren 45db0e60d2 alfred: use procd
Signed-off-by: Paul Spooren <mail@aparcar.org>
2018-07-20 18:23:10 +09:00
Adrian Schmutzler 135bc605b4 alfred: Support interface IDs with more than two digits
Occationally /proc/net/if_inet6 contains interface IDs with
three digits. In this case, the regex in wait_for_ll_address()
does not work anymore and alfred is not starting.

This patch changes the evaluation so that fields are used instead
of the mere position by counting characters.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-09 12:11:12 +02:00
Matthias Schiffer c40c8024ee alfred: not only wait for the interface, but also a link-local address
Changes between alfred 2015.0 and 2015.1 cause alfred to print an error
and exit when the interface to bind to is not completely set up (has no
non-tentative link-local address). As a workaround, wait for such an
address by reading /proc/net/if_inet6 before alfred is started.

In the long term, it would be nice to make alfred more robust against
missing interfaces (allowing alfred to start without the interface
existing, and keeping it working even when the interface is removed and
re-added while alfred is running).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2015-08-09 18:15:27 +02:00
Moritz Warning a251e8fb2a alfred: fix whitespaces 2015-05-31 10:39:59 +02:00
Moritz Warning 62275acf21 alfred: wait for batmanif and interface, ignore batmanif if it is set to 'none' 2015-05-31 02:52:25 +02:00
Gui Iribarren e2cfab7f28 alfred: workaround race condition when batmanif is not ready at boot time
Wait up to 30 seconds during init.d script on boot, so that batmanif can
come up. If the timeout is reached, the init.d script refuses to start
alfred and related daemons.

This prevents an alfred crash when it would start during early boot, before
batmanif is available. Instead, alfred is started as soon as batmanif appears,
if that happens during the 30-second window.

Signed-off-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2013-12-16 16:03:44 +01:00
Gui Iribarren 47a466ede6 alfred: fix batadv-vis invocation in init.d script
broken (wouldn't start, failing silently) since the following commit:
 * "renamed vis to batadv-vis to avoid collisions with other vis binaries"
which renamed only some instances of the "vis" command

Signed-off-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2013-12-16 16:03:44 +01:00
Gui Iribarren 14f85e7240 alfred: Add a lightweight framework for running facter scripts that feed data into alfred every 5 minutes
Alfred expects to be fed data periodically, but there's currently no easy
way to do that from scripts, prompting people to write whole C programs
to accomplish tasks that could easily be scripted.
Provide a really simple framework to run scripts every 5 minutes, using a
cronjob, when alfred is started by the init.d script.

Signed-off-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2013-10-23 01:37:47 +02:00
Simon Wunderlich f76074d424 alfred: add alfred 2013.3.0 to feed
Add A.L.F.R.E.D - Almighty Lightweight Fact Remote Exchange Daemon
to the OpenWRT routing feed. This package contains the latest stable
release of alfred which has been recently published by the
open-mesh.org community. A description follows below.

alfred is a user space daemon for distributing arbitrary local
information over the mesh/network in a decentralized fashion. This data
can be anything which appears to be useful - originally designed to
replace the batman-adv visualization (vis), you may distribute
hostnames, phone books, administration information, DNS information,
the local weather forecast ...

alfred runs as daemon in the background of the system. A user may insert
information by using the alfred binary on the command line, or use
special programs to communicate with alfred (done via unix sockets).
alfred then takes care of distributing the local information to other
alfred servers on other nodes. This is done via IPv6 link-local
multicast, and does not require any configuration. A user can request
data from alfred, and will receive the information available from all
alfred servers in the network.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-08-19 23:17:47 +02:00