zone-vnc-console revision 3998
3998N/A# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3998N/A# Licensed under the Apache License, Version 2.0 (the "License"); you may 3998N/A# not use this file except in compliance with the License. You may obtain 3998N/A# Unless required by applicable law or agreed to in writing, software 3998N/A# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 3998N/A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 3998N/A# License for the specific language governing permissions and limitations 3652N/A "# DO NOT EDIT THIS FILE. EDITS WILL BE LOST.\n" 3998N/A# Borderless, Monospsce font, point size 14, white foreground on black 3998N/A# background are reasonable defaults. 3998N/A '"Zone Console: $ZONENAME"' 3652N/A# Enclose command in comments to prevent xterm consuming zlogin opts 3652N/A # NOTE: 'geometry' below is that which matches the size of standard 3652N/A # 80 character undecorated xterm window using font style specified in 3998N/A # XTERMOPTS. The geometry doesn't matter too much because the display 3998N/A # will be resized using xrandr once the xterm geometry is established. 3652N/A "-geometry",
"964x580",
"-localhost",
"-autokill"]
3652N/A # first kill the SMF contract 3652N/A # 1 is returncode if no SMF contract processes were matched, 3652N/A # meaning they have already terminated. 3652N/A print "failed to kill the SMF contract: %s" %
cpe 3652N/A # reset port num prop to initial zero value 3652N/A print("VNC console service not available on this compute node. " 3652N/A print("VNC console service not available on this compute node. " 3998N/A """ Try to determine xterm window geometry and resize the Xvnc display 3998N/A to match using XRANDR. Treat failure as non-fatal since an 3998N/A incorrectly sized console is arguably better than none. 3998N/A Returns: tuple of window [width, height] 3998N/A print "Error finding console xwindow info: " +
err 3998N/A # Window is not mapped yet. 3998N/A # What, no width and height??? 3998N/A print "Discovered xterm not mapped yet. Retrying in 0.5s" 3998N/A print "Discovered xterm window is taking too long to map" 3998N/A print "Too many failed attempts to discover xterm window geometry" 3998N/A # Generate a mode line for width and height, with a refresh of 60.0Hz 3998N/A print "Error creating new modeline for VNC display: " +
err 3998N/A # Create a new mode for the Xvnc server using the modeline generated by gtf 3998N/A print "Error creating new xrandr modeline for VNC display: " +
err 3998N/A # Add the new mode to the default display output 3998N/A print "Error adding new xrandr modeline for VNC display: " +
err 3998N/A # Activate the new mode on the default display output 3998N/A print "Error setting new xrandr modeline for VNC display: " +
err