|
|
|
@ -114,26 +114,10 @@ $pidFile = "$vncUserDir/$host:$displayNumber.pid";
|
|
|
|
|
&StartXAndRecordPID();
|
|
|
|
|
|
|
|
|
|
# Give Xvnc a chance to start up
|
|
|
|
|
|
|
|
|
|
sleep(3);
|
|
|
|
|
if ($fontPath ne $defFontPath) {
|
|
|
|
|
unless (kill 0, `cat $pidFile`) {
|
|
|
|
|
if ($fpArgSpecified) {
|
|
|
|
|
warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n";
|
|
|
|
|
warn "path you specified using the -fp argument is incorrect. Attempting to\n";
|
|
|
|
|
warn "determine an appropriate font path for this system and restart Xvnc using\n";
|
|
|
|
|
warn "that font path ...\n";
|
|
|
|
|
} else {
|
|
|
|
|
warn "\nWARNING: The first attempt to start Xvnc failed, possibly because the font\n";
|
|
|
|
|
warn "catalog is not properly configured. Attempting to determine an appropriate\n";
|
|
|
|
|
warn "font path for this system and restart Xvnc using that font path ...\n";
|
|
|
|
|
}
|
|
|
|
|
$cmd =~ s@-fp [^ ]+@@;
|
|
|
|
|
$cmd .= " -fp $defFontPath" if ($defFontPath);
|
|
|
|
|
&StartXAndRecordPID();
|
|
|
|
|
sleep(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&IfXvncDidntStartTryFixingFontPathAndStartXvncAgain();
|
|
|
|
|
|
|
|
|
|
unless (kill 0, `cat $pidFile`) {
|
|
|
|
|
warn "Could not start Xvnc.\n\n";
|
|
|
|
|
unlink $pidFile;
|
|
|
|
@ -943,3 +927,24 @@ sub ConstructXvncCmd {
|
|
|
|
|
sub StartXAndRecordPID {
|
|
|
|
|
system("$cmd & echo \$! >$pidFile");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub IfXvncDidntStartTryFixingFontPathAndStartXvncAgain {
|
|
|
|
|
if ($fontPath ne $defFontPath) {
|
|
|
|
|
unless (kill 0, `cat $pidFile`) {
|
|
|
|
|
if ($fpArgSpecified) {
|
|
|
|
|
warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n";
|
|
|
|
|
warn "path you specified using the -fp argument is incorrect. Attempting to\n";
|
|
|
|
|
warn "determine an appropriate font path for this system and restart Xvnc using\n";
|
|
|
|
|
warn "that font path ...\n";
|
|
|
|
|
} else {
|
|
|
|
|
warn "\nWARNING: The first attempt to start Xvnc failed, possibly because the font\n";
|
|
|
|
|
warn "catalog is not properly configured. Attempting to determine an appropriate\n";
|
|
|
|
|
warn "font path for this system and restart Xvnc using that font path ...\n";
|
|
|
|
|
}
|
|
|
|
|
$cmd =~ s@-fp [^ ]+@@;
|
|
|
|
|
$cmd .= " -fp $defFontPath" if ($defFontPath);
|
|
|
|
|
&StartXAndRecordPID();
|
|
|
|
|
sleep(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|