Commit c83b2091 authored by Timothy Stack's avatar Timothy Stack

fix a race between watchdog and garcia-pilot starting up.

parent fa8d622e
...@@ -526,7 +526,7 @@ sub setintervals($) ...@@ -526,7 +526,7 @@ sub setintervals($)
if ($report) { if ($report) {
logmsg("setintervals: check=$iv{check}, isalive=$iv{isalive}, ". logmsg("setintervals: check=$iv{check}, isalive=$iv{isalive}, ".
"drift=$iv{drift}, cvsup=$iv{cvsup}, rusage=$iv{rusage}, ". "drift=$iv{drift}, cvsup=$iv{cvsup}, rusage=$iv{rusage}, ".
"hostkeys=$iv{hkeys} battery=$iv{batt}\n"); "hostkeys=$iv{hkeys}, battery=$iv{batt}\n");
} }
# #
...@@ -785,12 +785,11 @@ sub sendbatt($) ...@@ -785,12 +785,11 @@ sub sendbatt($)
} }
if (! -r $battlog) { if (! -r $battlog) {
logmsg("batt: no battery log $battlog\n"); logmsg("batt: no battery log yet $battlog\n");
$iv{batt} = 0; goto resched;
return;
} }
my $line = `tail -1 /var/log/battery.log`; my $line = `tail -1 $battlog`;
my $capacity; my $capacity;
my $voltage; my $voltage;
...@@ -837,6 +836,7 @@ sub sendbatt($) ...@@ -837,6 +836,7 @@ sub sendbatt($)
} }
} }
resched:
# #
# Set up for another interval. # Set up for another interval.
# Since the tmcc call and update can take awhile, we update curtime # Since the tmcc call and update can take awhile, we update curtime
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment