From: Bastian Bittorf Date: Mon, 11 Nov 2013 10:46:17 +0000 (+0100) Subject: olsrd: hotplug: dont test if daemon is enabled, but look for a written PID-file.... X-Git-Url: http://git.openwrt.org/?p=feed%2Frouting.git;a=commitdiff_plain;h=d49b01e8cc2dcee64861affbbc49e8b4abd3df39 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 --- diff --git a/olsrd/files/olsrd.hotplug.sh b/olsrd/files/olsrd.hotplug.sh index 6d1641f..db709a8 100755 --- a/olsrd/files/olsrd.hotplug.sh +++ b/olsrd/files/olsrd.hotplug.sh @@ -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 } } ;;