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