shutdown_servers_nam = "shutdown_servers"
foreground_nam = "foreground"
wake_up_session_nam = "wake_up_session"
+launcher_only_nam = "launcher_only"
+launcher_nam = "launcher"
# values in XML configuration file giving specific module parameters (<module_name> section)
# which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
# values of boolean type (must be '0' or '1').
# xml_parser.boolValue() is used for correct setting
-boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, except_nam, pinter_nam, shutdown_servers_nam )
+boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, except_nam, pinter_nam, shutdown_servers_nam, launcher_only_nam )
intKeys = ( interp_nam, )
+strKeys = ( launcher_nam )
# values of list type
listKeys = ( embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam )
self.opts[key] = self.boolValue( val ) # assign boolean value: 0 or 1
elif nam in intKeys:
self.opts[key] = self.intValue( val ) # assign integer value
+ elif nam in strKeys:
+ self.opts[key] = val # assign value
elif nam in listKeys:
self.opts[key] = [ self.strValue( a ) for a in re.split( "[:;,]", val ) ] # assign list value: []
else:
dest="print_port",
help=help_str)
+ # launch only omniNames and Launcher server
+ help_str = "launch only omniNames and Launcher server"
+ pars.add_argument("--launcher_only",
+ action="store_true",
+ dest="launcher_only",
+ help=help_str)
+
+ # machine and port where is the Launcher
+ help_str = "machine and port where is the Launcher. Usage: "
+ help_str += "--launcher=machine:port"
+ pars.add_argument("--launcher",
+ metavar="<=machine:port>",
+ type=str,
+ dest="launcher",
+ help=help_str)
+
# Do not relink ${HOME}/.omniORB_last.cfg
help_str = "Do not save current configuration ${HOME}/.omniORB_last.cfg"
pars.add_argument("--nosave-config",
# - Command line options have the highest priority and replace options
# specified in configuration file(s)
###
-
global args
config_var = appname+'Config'
args[shutdown_servers_nam] = cmd_opts.shutdown_servers
pass
+ # Launcher only
+ if cmd_opts.launcher_only is not None:
+ args[launcher_only_nam] = cmd_opts.launcher_only
+
+ # machine and port where is the Launcher
+ if cmd_opts.launcher is not None:
+ args[launcher_nam] = cmd_opts.launcher
+
# Foreground
if cmd_opts.foreground is None:
args[foreground_nam] = 1
def __init__(self,args=None):
# Initialise the ORB
+
+ if 'launcher' in args:
+ pos = args['launcher'].find(":")
+ if pos != -1:
+ machine = args['launcher'][0:pos]
+ port = args['launcher'][pos+1:]
+ sys.argv.append('-ORBInitRef')
+ sys.argv.append("NameService=corbaname::" + machine + ":" + port)
+ print("Connect to naming service on machine: "+machine+" port: "+port)
self.orb=CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
# Initialise the Naming Service
self.args=args
self.initArgs()
self.CMD=['SALOME_ConnectionManagerServer']
+ if 'launcher' in self.args:
+ pos = args['launcher'].find(":")
+ if pos != -1:
+ self.CMD+=['-ORBInitRef']
+ machine = args['launcher'][0:pos]
+ port = args['launcher'][pos+1:]
+ self.CMD+=["NameService=corbaname::" + machine + ":" + port]
+
# ---
self.initArgs()
self.SCMD1=['SALOME_Session_Server']
self.SCMD2=[]
+ if 'launcher' in self.args:
+ pos = args['launcher'].find(":")
+ if pos != -1:
+ self.SCMD1+=['-ORBInitRef']
+ machine = args['launcher'][0:pos]
+ port = args['launcher'][pos+1:]
+ self.SCMD1+=["NameService=corbaname::" + machine + ":" + port]
if 'registry' in self.args['embedded']:
self.SCMD1+=['--with','Registry',
'(','--salome_session','theSession',')']
# Launch Session Server (to show splash ASAP)
#
- if args["gui"]:
+ if args["gui"] and not args['launcher_only']:
mySessionServ = SessionServer(args,args['modules'],modules_root_dir)
mySessionServ.setpath(modules_list,modules_root_dir)
mySessionServ.run()
# Launch LauncherServer
#
- myCmServer = LauncherServer(args)
- myCmServer.setpath(modules_list,modules_root_dir)
- myCmServer.run()
+ if not 'launcher' in args:
+ myCmServer = LauncherServer(args)
+ myCmServer.setpath(modules_list,modules_root_dir)
+ myCmServer.run()
#
# Launch ConnectionManagerServer
#
- myConnectionServer = ConnectionManagerServer(args)
- myConnectionServer.run()
-
+ if not args['launcher_only']:
+ myConnectionServer = ConnectionManagerServer(args)
+ myConnectionServer.run()
from Utils_Identity import getShortHostName
# Wait until Session Server is registered in naming service
#
- if args["gui"]:
+ if args["gui"] and not args['launcher_only']:
##----------------
import Engines
import SALOME
if args['wake_up_session']:
test = False
pass
- if test:
+ if test and not 'launcher' in args:
from searchFreePort import searchFreePort
searchFreePort(args, save_config, args.get('useport'))
pass