zone-vnc-console revision 3652
import pwd
XSTARTUPHDR = "# WARNING: THIS FILE GENERATED BY SMF.\n" + \
"# DO NOT EDIT THIS FILE. EDITS WILL BE LOST.\n"
# Monospsce font, point size 15, white foreground on black background"
XTERMOPTS = ' -fa Monospace -fs 15 -fg white -bg black'
# Enclose command in comments to prevent xterm consuming zlogin opts
try:
# NOTE: 'geometry' below is that which matches the size of standard
# 80 character undecorated xterm window using font style specified in
# XTERMOPTS. Update this geometry whenever XTERMOPTS are changed.
# Avoids exposing X root window within noVNC canvas widget.
"-geometry", "964x580", "-localhost", "-autokill"]
if vncret != 0:
print "Error starting VNC server: " + err
print e
# set host prop
print "VNC port: %d" % port
# set port num prop
if retcode != 0:
return smf_include.SMF_EXIT_OK
def stop():
try:
# first kill the SMF contract
# 1 is returncode if no SMF contract processes were matched,
# meaning they have already terminated.
if cpe.returncode != 1:
print "failed to kill the SMF contract: %s" % cpe
try:
# reset port num prop to initial zero value
'0']
if retcode != 0:
print e
print("VNC console service not available on this compute node. "
% VNCSERVER)
print("VNC console service not available on this compute node. "
% XTERM)
try:
if ose.errno != errno.EEXIST:
# Always clobber xstartup
# stemp tuple = [fd, path]
os.rename(stemp[1], xstartup_path)
if __name__ == "__main__":