Commit cc34c36e authored by Mike Hibler's avatar Mike Hibler

Make sure sshd.pid file survives running "prepare".

If we don't, then you cannot HUP sshd to have it re-read the config file.
Apparently this didn't used to matter, but now if we do not HUP sshd,
the initial V1 key-pair does not work.
parent 71159201
......@@ -894,9 +894,15 @@ sub SetupFsNode()
}
}
my $sshdpid = "";
if (-r "/var/run/sshd.pid") {
$sshdpid = `cat /var/run/sshd.pid`;
chomp($sshdpid);
}
#
# Run the prepare script to clear out the current accounts and such.
# From this point on will need to log in as root,
# From this point on will need to log in as root.
#
print "Clearing out existing accounts and such\n";
mysystem("$BINDIR/prepare -N");
......@@ -919,6 +925,15 @@ sub SetupFsNode()
mysystem("echo '$vid' > $BOOTDIR/vmname");
}
#
# XXX did I mention what an a**hole prepare can be?
# Put back the sshd pid file that it removed so that that
# the install scripts can HUP sshd.
#
if ($sshdpid) {
mysystem("echo '$sshdpid' > /var/run/sshd.pid");
}
#
# Remove the outer testbed startup script.
#
......@@ -1386,9 +1401,15 @@ sub SetupOpsNode($)
}
}
my $sshdpid = "";
if (-r "/var/run/sshd.pid") {
$sshdpid = `cat /var/run/sshd.pid`;
chomp($sshdpid);
}
#
# Run the prepare script to clear out the current accounts and such.
# From this point on will need to log in as root,
# From this point on will need to log in as root.
#
print "Clearing out existing accounts and such\n";
mysystem("$BINDIR/prepare -N");
......@@ -1411,6 +1432,15 @@ sub SetupOpsNode($)
mysystem("echo '$vid' > $BOOTDIR/vmname");
}
#
# XXX did I mention what an a**hole prepare can be?
# Put back the sshd pid file that it removed so that that
# the install scripts can HUP sshd.
#
if ($sshdpid) {
mysystem("echo '$sshdpid' > /var/run/sshd.pid");
}
#
# Remove the outer testbed startup script.
#
......@@ -2063,6 +2093,12 @@ sub SetupBossNode($)
}
}
my $sshdpid = "";
if (-r "/var/run/sshd.pid") {
$sshdpid = `cat /var/run/sshd.pid`;
chomp($sshdpid);
}
#
# Save off the bootdir for getting the ops vm started up.
# Stash into /var/boot for CreateOpsJail() below.
......@@ -2096,6 +2132,15 @@ sub SetupBossNode($)
mysystem("echo '$vid' > $BOOTDIR/vmname");
}
#
# XXX did I mention what an a**hole prepare can be?
# Put back the sshd pid file that it removed so that that
# the install scripts can HUP sshd.
#
if ($sshdpid) {
mysystem("echo '$sshdpid' > /var/run/sshd.pid");
}
#
# Remove the outer testbed startup script.
#
......@@ -2721,6 +2766,12 @@ sub SetupOpsJail()
}
}
my $sshdpid = "";
if (-r "/var/run/sshd.pid") {
$sshdpid = `cat /var/run/sshd.pid`;
chomp($sshdpid);
}
#
# Run the prepare script to clear out the current accounts and such.
# From this point on will need to log in as root,
......@@ -2746,6 +2797,15 @@ sub SetupOpsJail()
mysystem("echo '$vid' > $BOOTDIR/vmname");
}
#
# XXX did I mention what an a**hole prepare can be?
# Put back the sshd pid file that it removed so that that
# the install scripts can HUP sshd.
#
if ($sshdpid) {
mysystem("echo '$sshdpid' > /var/run/sshd.pid");
}
#
# Remove the outer testbed startup script.
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment