Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
5f0c970b
Commit
5f0c970b
authored
Nov 16, 2015
by
Mike Hibler
Browse files
Argh! I couldn't take it any longer: start vnodes in numeric order!
No more 1,10,11..19,2,20,21...
parent
0b847cfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/bootvnodes
View file @
5f0c970b
#!/usr/bin/perl -w
#
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -194,6 +194,20 @@ foreach my $str (@tmccresults) {
}
}
#
# Sort by vnode number if it follows are convention. We need this because
# we don't use a fixed field width for the vnode number.
# XXX I am sure there are more perl-ish ways to do this.
#
sub
byvnode
{
if
(
$a
=~
/^(.*)-(\d+)$/
&&
(
$apre
=
$
1
)
&&
(
$anum
=
$
2
)
&&
$b
=~
/^(.*)-(\d+)$/
&&
(
$bpre
=
$
1
)
&&
(
$bnum
=
$
2
)
&&
$apre
eq
$bpre
)
{
return
$anum
<=>
$bnum
;
}
return
$a
cmp
$b
;
}
#
# If doing a reconfig, get the current set of vnodes that are running.
# We want to compare that list against the list we just got from tmcd.
...
...
@@ -219,7 +233,7 @@ if ($reconfig) {
# Reboot nodes that are running and in the current list from tmcd.
# Kill nodes that are running but not in the current list from tmcd.
#
foreach
my
$vnode
(
sort
(
keys
(
%curvnodelist
))
)
{
foreach
my
$vnode
(
sort
byvnode
keys
(
%curvnodelist
))
{
if
(
exists
(
$newvnodelist
{
$vnode
}))
{
bootvnode
(
$vnode
,
(
defined
(
$action
)
?
$action
:
"
reboot
"),
...
...
@@ -242,7 +256,7 @@ exit(0)
prebootvnodes
(
\
%curvnodelist
,
\
%newvnodelist
)
if
(
!
$fakejails
);
foreach
my
$vnode
(
sort
(
keys
(
%newvnodelist
))
)
{
foreach
my
$vnode
(
sort
byvnode
keys
(
%newvnodelist
))
{
# Blocks until mostly setup.
bootvnode
(
$vnode
,
"
boot
",
$newvnodelist
{
$vnode
});
}
...
...
Write
Preview
Supports
Markdown
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