olsrd: hotplug: dont test if daemon is enabled, but look for a written PID-file. this solves the issue, that hotplug fires multiple restarts during boot for each upcoming interface (e.g. lo, lan, wan, wifi1, wifi2) which is racy somehow, but leaves hotplug itself working after normal startup. also reduce forking by directly sourcing '/etc/init.d/olsrd' via rc.common

This commit is contained in:
Bastian Bittorf 2013-11-11 11:46:17 +01:00
parent 89c2a8bb56
commit d49b01e8cc
1 changed files with 4 additions and 2 deletions

View File

@ -44,9 +44,11 @@ olsrd_interface_needs_adding()
case "$ACTION" in
ifup)
/etc/init.d/olsrd enabled && {
# only work after the first normal startup
# also: no need to test, if enabled
[ -e '/var/run/olsrd.pid' ] && {
olsrd_interface_needs_adding "$INTERFACE" "$DEVICE" && {
/etc/init.d/olsrd restart
. /etc/rc.common /etc/init.d/olsrd restart
}
}
;;