olsrd: fix olsrd starting before network
Should fix #691. Sometimes the wifi interface is not ready before olsrd tries to access it. This leads to warnings in the form of: daemon.info olsrd: /etc/rc.d/S65olsrd: olsrd_write_interface() Warning: Interface 'wireless0' not found, skipped daemon.notice procd: /etc/rc.d/S65olsrd: olsrd: /etc/rc.d/S65olsrd: olsrd_write_interface() Warning: Interface 'wireless0' not found, skipped We make use of the "wait_for" procd command that allows us to wait for the network before starting olsrd. Tested-by: Noki Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
5a09ac1180
commit
911c0cb45a
2 changed files with 23 additions and 0 deletions
|
@ -10,6 +10,18 @@ OLSRD=olsrd
|
||||||
CONF=/var/etc/$OLSRD.conf
|
CONF=/var/etc/$OLSRD.conf
|
||||||
PID=/var/run/olsrd.pid
|
PID=/var/run/olsrd.pid
|
||||||
|
|
||||||
|
wait_for_network()
|
||||||
|
{
|
||||||
|
ubus -t 15 wait_for network.interface.$1 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
boot()
|
||||||
|
{
|
||||||
|
config_load network
|
||||||
|
config_foreach wait_for_network interface
|
||||||
|
rc_procd start_service
|
||||||
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
olsrd_generate_config $OLSRD
|
olsrd_generate_config $OLSRD
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,17 @@ OLSRD=olsrd6
|
||||||
CONF=/var/etc/$OLSRD.conf
|
CONF=/var/etc/$OLSRD.conf
|
||||||
PID=/var/run/olsrd6.pid
|
PID=/var/run/olsrd6.pid
|
||||||
|
|
||||||
|
wait_for_network()
|
||||||
|
{
|
||||||
|
ubus -t 15 wait_for network.interface.$1 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
boot()
|
||||||
|
{
|
||||||
|
config_load network
|
||||||
|
config_foreach wait_for_network interface
|
||||||
|
rc_procd start_service
|
||||||
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
olsrd_generate_config $OLSRD
|
olsrd_generate_config $OLSRD
|
||||||
|
|
Loading…
Reference in a new issue