Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
emulab-devel
Commits
d75ced68
Commit
d75ced68
authored
19 years ago
by
Mike Hibler
Browse files
Options
Downloads
Patches
Plain Diff
Hack to get around apparent overrun of UART causing malformed commands to
the controller.
parent
0b016a54
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tbsetup/power_rpc27.pm.in
+19
-0
19 additions, 0 deletions
tbsetup/power_rpc27.pm.in
with
19 additions
and
0 deletions
tbsetup/power_rpc27.pm.in
+
19
−
0
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
";
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment