Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
d75ced68
Commit
d75ced68
authored
Apr 04, 2005
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to get around apparent overrun of UART causing malformed commands to
the controller.
parent
0b016a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
tbsetup/power_rpc27.pm.in
tbsetup/power_rpc27.pm.in
+19
-0
No files found.
tbsetup/power_rpc27.pm.in
View file @
d75ced68
...
...
@@ -17,6 +17,7 @@ use Socket;
use
IO
::
Handle
;
use
lib
"@prefix@/lib"
;
use
libdb
;
use
POSIX
qw
(
strftime
);
#
A
little
perl
module
to
power
cycle
something
attached
to
an
RPC27
.
#
Thats
a
serially
controlled
,
power
controller
.
...
...
@@ -53,6 +54,13 @@ sub rpc27ctrl {
my($cmd, $controller, @outlets) = @_;
my($TIP, $i, $insync);
#
# Check parameters
#
if (!defined($RPC27_CMD{$cmd})) {
print STDERR "*** Undefined command: '
$
cmd
'\n";
return 1;
}
if (grep {$_ < 1 || $_ > 20} @outlets) {
print STDERR "*** Invalid outlet '
$
outlet
': Must be 1-20\n";
return 1;
...
...
@@ -157,6 +165,17 @@ sub syncandsend($$) {
return 1;
}
#
# These things have an annoying tendency to fail sometimes by losing
# the command part of the string (e.g., "6" instead of "reboot 6").
# I think we are overrunning the UART with "\r\n" since we put out
# a pair after every line we read that is not a prompt and when the
# RPC puts out its banner, it is a good 10 lines before we see the
# prompt. So allow some time for the RPC to digest everything before
# we feed it the command.
#
sleep(1);
if ($debug) {
print "Sending '
$
cmd
' to $controller\n";
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment