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 $JAVA_OPTS = Get-Java-Opts
11 
12 # Read an optional running configuration file
13 $STANDALONE_CONF_FILE = $scripts + '\standalone.conf.ps1'
14 $STANDALONE_CONF_FILE = Get-Env RUN_CONF $STANDALONE_CONF_FILE
15 . $STANDALONE_CONF_FILE
16 
17 Write-Debug "debug is: $global:DEBUG_MODE"
18 Write-Debug "debug port: $global:DEBUG_PORT"
19 Write-Debug "sec mgr: $SECMGR"
20 
21 if ($SECMGR) {
22     $MODULE_OPTS +="-secmgr";
23 }
24 # Set debug settings if not already set
25 if ($global:DEBUG_MODE){
26     if ($JAVA_OPTS -notcontains ('-agentlib:jdwp')){
27         $JAVA_OPTS+= "-agentlib:jdwp=transport=dt_socket,address=$global:DEBUG_PORT,server=y,suspend=n"
28     }else{
29         echo "Debug already enabled in JAVA_OPTS, ignoring --debug argument"
30     }
31 }
32 
33 $backgroundProcess = Get-Env LAUNCH_JBOSS_IN_BACKGROUND 'false'
34 $runInBackGround = $global:RUN_IN_BACKGROUND -or ($backgroundProcess -eq 'true')
35 
36 $PROG_ARGS = Get-Java-Arguments -entryModule "org.jboss.as.standalone" -serverOpts $SERVER_OPTS
37 
38 Display-Environment $global:FINAL_JAVA_OPTS
39 
40 Start-WildFly-Process -programArguments $PROG_ARGS -runInBackground $runInBackGround