vncserver: extract WarnUserXvncNotStartedAndExit()

This commit is contained in:
Dmitry Maksyoma 2021-08-02 00:27:11 +12:00
parent 7954cc506c
commit df5d3e506d

View File

@ -119,12 +119,7 @@ sleep(3);
&IfXvncDidntStartTryFixingFontPathAndStartXvncAgain(); &IfXvncDidntStartTryFixingFontPathAndStartXvncAgain();
unless (&IsXvncRunning()) { unless (&IsXvncRunning()) {
warn "Could not start Xvnc.\n\n"; &WarnUserXvncNotStartedAndExit();
unlink $pidFile;
open(LOG, "<$desktopLog");
while (<LOG>) { print; }
close(LOG);
die "\n";
} }
warn "\nNew '$desktopName' desktop is $host:$displayNumber\n"; warn "\nNew '$desktopName' desktop is $host:$displayNumber\n";
@ -952,3 +947,12 @@ sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain {
sub IsXvncRunning { sub IsXvncRunning {
kill 0, `cat $pidFile`; kill 0, `cat $pidFile`;
} }
sub WarnUserXvncNotStartedAndExit {
warn "Could not start Xvnc.\n\n";
unlink $pidFile;
open(LOG, "<$desktopLog");
while (<LOG>) { print; }
close(LOG);
die "\n";
}