6852N/A# Copyright (c) 2014, 2016, 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"' 4551N/A# Port ranges allocated for VNC and X11 sockets. 3652N/A# Enclose command in comments to prevent xterm consuming zlogin opts 4551N/A # This is meant to be an on-demand service. 4551N/A # Determine if nova-compute requested enablement of this instance. 4551N/A # Exit with SMF_EXIT_TEMP_DISABLE if not true. 4551N/A "nova-compute starts this service on demand") 4551N/A # NOTE: 'geometry' is that which matches the size of standard 4551N/A # 80 character undecorated xterm window using font style specified 4551N/A # in XTERMOPTS. The geometry doesn't matter too much because the 4551N/A # display will be resized using xrandr once the xterm geometry is 4551N/A "-SecurityTypes=None",
"-geometry",
"964x580",
4551N/A # set SMF instance port num prop 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] 4046N/A UninitializedWindowError if window not yet initialized 3998N/A print "Error finding console xwindow info: " +
err 3998N/A # Window is not mapped yet. 3998N/A # What, no width and height??? 4046N/A print "xterm window not initialized yet. Retrying in %ds" \
4046N/A print "xterm window is taking too long to initialize" 4046N/A print "Discovered xterm not mapped yet. Retrying in %ds" \
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 4551N/A """Ensures instance exclusive use of VNC, X11 service ports 4551N/A Generator yields an integer of the port relative to port_start to use. 4551N/A eg. 32: VNC port 5932, X11 port 6032, X11 display :32 4551N/A lockfile is port specific and prevents multiple instances from 4551N/A attempting to use the same port number during SMF start method 4551N/A Socket binding on address:port establishes that the port is not 4551N/A already in use by another Xvnc process 4551N/A # Acquire port file lock first to lock out other instances trying 4551N/A # to come online in parallel. They will grab the next available 4551N/A # Ensure the standard X11 locking files are not present 4551N/A print ("Warning: X11 display :{0} is taken because of " 4551N/A "{1}\nRemove this file if there is no X "