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-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
7eb2adb6
Commit
7eb2adb6
authored
Jan 12, 2004
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -a option to reboot all free pcs.
parent
17a431e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
6 deletions
+35
-6
tbsetup/node_reboot.in
tbsetup/node_reboot.in
+35
-6
No files found.
tbsetup/node_reboot.in
View file @
7eb2adb6
...
...
@@ -25,12 +25,13 @@ sub usage()
"
Use the -n option to not wait for nodes to go down
\n
"
.
"
Use the -w option to to wait for nodes is come back up
\n
"
.
"
Use the -k option to power cycle nodes in PXEWAIT mode
\n
"
.
"
Use the -a option to reboot all free nodes
\n
"
.
"
Use the -f option to power cycle (and not wait for nodes to die)
\n
";
exit
(
-
1
);
}
# The hidden -r option runs this in "realmode", ie don't send an event, but
# really do the work instead.
my
$optlist
=
"
dfe:nwrk
";
my
$optlist
=
"
dfe:nwrk
a
";
#
# Configure variables
...
...
@@ -66,6 +67,7 @@ my $nowait = 0;
my
$failed
=
0
;
my
$eidmode
=
0
;
my
$killmode
=
0
;
my
$freemode
=
0
;
my
$pid
;
my
$eid
;
...
...
@@ -106,6 +108,9 @@ if (defined($options{"w"})) {
if
(
defined
(
$options
{"
r
"}))
{
$realmode
=
1
;
}
if
(
defined
(
$options
{"
a
"}))
{
$freemode
=
1
;
}
if
(
defined
(
$options
{"
n
"})
&&
!
defined
(
$options
{"
w
"}))
{
$nowait
=
1
;
}
...
...
@@ -131,11 +136,35 @@ $realmode=1;
# die("*** You cannot use real mode!\n");
#}
#
# If eidmode, then get the node list out of the DB instead of the command
# line. A proper check is made later, so need to be fancy about the query.
#
if
(
$eidmode
)
{
if
(
$freemode
)
{
#
# Reboot all free nodes
#
if
(
$UID
&&
!
TBAdmin
(
$UID
))
{
die
("
*** You not have permission to reboot all free nodes!
\n
");
}
my
$query_result
=
DBQueryFatal
("
select n.node_id from nodes as n
"
.
"
left join reserved as r on r.node_id=n.node_id
"
.
"
left join node_types as nt on nt.type=n.type
"
.
"
where nt.class='pc' and n.role='testnode' and
"
.
"
r.pid is NULL
");
if
(
$query_result
->
numrows
==
0
)
{
print
STDOUT
"
There are no free nodes to reboot
\n
";
usage
();
}
while
(
@row
=
$query_result
->
fetchrow_array
())
{
push
(
@nodes
,
$row
[
0
]);
}
}
elsif
(
$eidmode
)
{
#
# If eidmode, then get the node list out of the DB instead of the command
# line. A proper check is made later, so need to be fancy about the query.
#
my
@row
;
#
...
...
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