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
f34f900d
Commit
f34f900d
authored
Jun 23, 2010
by
Leigh B Stoller
Browse files
Do not kill the container if an error happens during a reboot of an
existing containter.
parent
e9472de4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/linux/mkvnode.pl
View file @
f34f900d
...
@@ -25,6 +25,7 @@ sub usage()
...
@@ -25,6 +25,7 @@ sub usage()
my
$optlist
=
"
d
";
my
$optlist
=
"
d
";
my
$debug
=
1
;
my
$debug
=
1
;
my
$leaveme
=
0
;
my
$leaveme
=
0
;
my
$running
=
0
;
my
$cleaning
=
0
;
my
$cleaning
=
0
;
my
$rebooting
=
0
;
my
$rebooting
=
0
;
my
$vnodeid
;
my
$vnodeid
;
...
@@ -147,12 +148,8 @@ if ($DOMAINNAME =~ /^[-\w]+\.(.*)$/) {
...
@@ -147,12 +148,8 @@ if ($DOMAINNAME =~ /^[-\w]+\.(.*)$/) {
else
{
else
{
die
("
Could not parse domain name!
");
die
("
Could not parse domain name!
");
}
}
#
# Need the bossip, which was returned above
#
if
(
$BOSSIP
!~
/^\d+\.\d+\.\d+\.\d+$/
)
{
if
(
$BOSSIP
!~
/^\d+\.\d+\.\d+\.\d+$/
)
{
die
"
Bad bossip '
$BOSSIP
'
in
$BOOTDIR
/
bossi
p
!
";
die
"
Bad bossip '
$BOSSIP
'
from
bossi
nfo
!
";
}
}
#
#
...
@@ -287,6 +284,8 @@ if (! -e "$VNDIR/vnode.info") {
...
@@ -287,6 +284,8 @@ if (! -e "$VNDIR/vnode.info") {
mysystem
("
mkdir -p /var/emulab/jails/
$vnodeid
");
mysystem
("
mkdir -p /var/emulab/jails/
$vnodeid
");
}
}
else
{
else
{
$rebooting
=
1
;
my
$str
=
`
cat
$VNDIR
/vnode.info
`;
my
$str
=
`
cat
$VNDIR
/vnode.info
`;
chomp
(
$str
);
chomp
(
$str
);
(
$vmid
,
$vmtype
)
=
(
$str
=~
/^(\d*) (\w*)$/
);
(
$vmid
,
$vmtype
)
=
(
$str
=~
/^(\d*) (\w*)$/
);
...
@@ -301,7 +300,6 @@ else {
...
@@ -301,7 +300,6 @@ else {
if
(
$ret
ne
VNODE_STATUS_STOPPED
())
{
if
(
$ret
ne
VNODE_STATUS_STOPPED
())
{
MyFatal
("
vnode
$vnodeid
not stopped, not booting!
");
MyFatal
("
vnode
$vnodeid
not stopped, not booting!
");
}
}
$rebooting
=
1
;
}
}
my
$cnet_mac
=
ipToMac
(
$vnconfig
{'
CTRLIP
'});
my
$cnet_mac
=
ipToMac
(
$vnconfig
{'
CTRLIP
'});
...
@@ -446,6 +444,7 @@ TBDebugTimeStamp("finished $vmtype rootPostConfig()")
...
@@ -446,6 +444,7 @@ TBDebugTimeStamp("finished $vmtype rootPostConfig()")
# This is for vnodesetup
# This is for vnodesetup
mysystem
("
touch
$VNDIR
/running
");
mysystem
("
touch
$VNDIR
/running
");
$running
=
1
;
#
#
# Install a signal handler to catch signals from vnodesetup.
# Install a signal handler to catch signals from vnodesetup.
...
@@ -596,6 +595,13 @@ sub MyFatal($)
...
@@ -596,6 +595,13 @@ sub MyFatal($)
{
{
my
(
$msg
)
=
@_
;
my
(
$msg
)
=
@_
;
#
# If rebooting but never got a chance to run, we do not want
# to kill off the container. Might lose user data.
#
$leaveme
=
1
if
(
$rebooting
&&
!
$running
);
Cleanup
();
Cleanup
();
die
("
*** $0:
\n
"
.
die
("
*** $0:
\n
"
.
"
$msg
\n
");
"
$msg
\n
");
...
...
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