Skip to content
Snippets Groups Projects
Commit 6dfb5b4e authored by Yang Tse's avatar Yang Tse
Browse files

Don't gather additional debug info unless sshd actually fails

parent 93008575
No related branches found
No related tags found
No related merge requests found
......@@ -304,17 +304,24 @@ if (system "$sshd -t -f $conffile > log/sshd.log 2>&1") {
}
# Start the server
my $rc = system "$sshd -e -D -f $conffile > log/sshd.log 2>&1";
$rc >>= 8;
if($rc && $verbose) {
print STDERR "$sshd exited with $rc!\n";
my $cmdretval = system "$sshd -e -D -f $conffile > log/sshd.log 2>&1";
my $cmdnoexec = $!;
if ($cmdretval == -1) {
print "$sshd failed with: \n";
print "$cmdnoexec \n";
displayfile("log/sshd.log");
displayfile("$conffile");
}
if($rc) {
print "$sshd exited with $rc!\n";
elsif ($cmdretval & 127) {
printf("$sshd died with signal %d, and %s coredump.\n",
($cmdretval & 127), ($cmdretval & 128)?"a":"no");
displayfile("log/sshd.log");
displayfile("$conffile");
}
elsif ($verbose && ($cmdretval >> 8)) {
printf("$sshd exited with %d \n", $cmdretval >> 8);
}
unlink $conffile;
exit $rc;
exit $cmdretval >> 8;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment