bugfix: olsrd-watchdog false reports

olsrd-watchdog can trigger when the olsrd service is restarted
Such as when a tunnel comes up, or when a config change is
made to olsrd.

procd already monitors olsrd and makes sure it remains running.

With procd we no longer need olsrd-watchdog and can remove it.

fixes AREDN->ticket:215

Change-Id: I5067d380a22bd0ab5e597746478ef3e1ba05d72d
This commit is contained in:
Conrad Lara - KG6JEI 2017-03-20 22:42:58 -07:00 committed by KG6JEI
parent 9c0f5bf7c6
commit a57d5cd08c
7 changed files with 1 additions and 75 deletions

View File

@ -61,7 +61,6 @@ CONFIG_PACKAGE_olsrd-mod-nameservice=y
CONFIG_PACKAGE_olsrd-mod-txtinfo=y
CONFIG_PACKAGE_olsrd-mod-jsoninfo=y
CONFIG_PACKAGE_olsrd-mod-dot-draw=y
CONFIG_PACKAGE_olsrd-mod-watchdog=y
CONFIG_PACKAGE_olsrd-mod-secure=y
CONFIG_PACKAGE_perlbase-essential=y
CONFIG_PACKAGE_perlbase-xsloader=y

View File

@ -35,11 +35,6 @@ config LoadPlugin
option accept '127.0.0.1'
option port '2003'
config LoadPlugin
option library 'olsrd_watchdog.so.0.1'
option file '/tmp/olsrd.watchdog'
option interval '5'
config Interface
list interface 'wifi'

View File

@ -70,7 +70,6 @@ olsrd-mod-httpinfo
olsrd-mod-nameservice
olsrd-mod-secure
olsrd-mod-txtinfo
olsrd-mod-watchdog
opkg
perl
perlbase-essential

View File

@ -423,7 +423,6 @@ unless($cfg{wifi_proto} eq "disabled")
{
printf FILE "echo %s,%s > /tmp/latlon.txt\n", $cfg{aprs_lat}, $cfg{aprs_lon};
}
print FILE "/usr/local/bin/olsrd-watchdog &\n";
print FILE "/usr/local/bin/olsrd-namechange-loop &\n";
}
close(FILE);

View File

@ -1,47 +0,0 @@
#!/bin/sh
<<'LICENSE'
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
Copyright (C) 2015 Conrad Lara
See Contributors file for additional contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
LICENSE
# wait for the watchdog file to appear before starting
while [ ! -f "/tmp/olsrd.watchdog" ]
do
sleep 15
done
while true
do
if [ -f "/tmp/olsrd.watchdog" ]
then
rm -f "/tmp/olsrd.watchdog"
else
uptime=$(cut -d' ' -f1 < /proc/uptime)
date=$(date)
echo "$uptime $date" >> /tmp/olsrd.log
/etc/init.d/olsrd restart
fi
# With interval of 5 seconds this gives ~3 chances
# for a file write before next loop.
sleep 15
done

View File

@ -28,7 +28,7 @@ start_upgrade_mode() {
/usr/local/bin/linkled upgrade
# Purge the /tmp/ filesystem of unneeded files.
rm -Rf /tmp/node.history /tmp/olsrd.log /tmp/olsrd.watchdog /tmp/snrlog/ /tmp/snr.dat /tmp/web/firmware.list /tmp/.uci
rm -Rf /tmp/node.history /tmp/snrlog/ /tmp/snr.dat /tmp/web/firmware.list /tmp/.uci
}

View File

@ -184,25 +184,6 @@ if($browser_ip)
push @col1, $str . "</td>";
}
if(-f "/tmp/olsrd.log")
{
chomp($lines = `wc -l /tmp/olsrd.log | awk '{print \$1}'`);
chomp($start = `tail -n1 /tmp/olsrd.log | awk '{print \$1}'`);
chomp($uptime = `cat /proc/uptime | cut -f1 -d.`);
$uptime -= $start;
$up_d = int($uptime/86400);
$uptime -= $up_d*86400;
$up_h = int($uptime/3600);
$uptime -= $up_h*3600;
$up_m = int($uptime/60);
$up_s = $uptime - $up_m*60;
$str = "<th align=right><nobr>OLSR restarts</nobr><br>runtime</th>";
$str .= sprintf "<td>%d<br><nobr>%d - %02d:%02d:%02d</nobr></td></tr>",
$lines, $up_d, $up_h, $up_m, $up_s;
push @col1, "<td> </td><td> </td>";
push @col1, $str;
}
# right column - system info