1 ############################################################################# 2 # ## 3 # WildFly Startup Script for starting the standalone server ## 4 # ## 5 ############################################################################# 6 7 $scripts = (Get-ChildItem $MyInvocation.MyCommand.Path).Directory.FullName; 8 . $scripts'\common.ps1' 9 $SERVER_OPTS = Process-Script-Parameters -Params $ARGS 10 11 # Read an optional running configuration file 12 $STANDALONE_CONF_FILE = $scripts + '\standalone.conf.ps1' 13 $STANDALONE_CONF_FILE = Get-Env RUN_CONF $STANDALONE_CONF_FILE 14 . $STANDALONE_CONF_FILE 15 16 Write-Debug "debug is: $global:DEBUG_MODE" 17 Write-Debug "debug port: $global:DEBUG_PORT" 18 Write-Debug "sec mgr: $global:SECMGR" 19 20 if ($global:SECMGR) { 21 $MODULE_OPTS +="-secmgr"; 22 } 23 # Set debug settings if not already set 24 if ($global:DEBUG_MODE){ 25 if ($JAVA_OPTS -notcontains ('-agentlib:jdwp')){ 26 $JAVA_OPTS+= "-agentlib:jdwp=transport=dt_socket,address=$global:DEBUG_PORT,server=y,suspend=n" 27 }else{ 28 echo "Debug already enabled in JAVA_OPTS, ignoring --debug argument" 29 } 30 } 31 32 $backgroundProcess = Get-Env LAUNCH_JBOSS_IN_BACKGROUND 'false' 33 $runInBackGround = $global:RUN_IN_BACKGROUND -or ($backgroundProcess -eq 'true') 34 35 Display-Environment 36 37 $PROG_ARGS = Get-Java-Arguments -entryModule "org.jboss.as.standalone" -serverOpts $SERVER_OPTS 38 39 Start-WildFly-Process -programArguments $PROG_ARGS -runInBackground $runInBackGround