title: How to set JBOSS_BASE_DIR for different WildFly instances?
body: <h2>My Setup</h2>
  
  <p>I'm currently running 2 instances of WildFly 9.0.0.CR1 on a Linux machine.</p>
  
  <p>I have install scripts that set everything up. It creates a <code>sim_standalone</code> folder in addition to the existing <code>standalone</code> folder and copies in a <code>sim-standalone-full.xml</code> file (this file offsets the port number by 100).</p>
  
  <p>They are both installed as services under <code>/etc/init.d/wildfly</code> and <code>/etc/init.d/sim-wildfly</code>, with <code>sim-wildfly</code> being tweaked to use a different configuration file (it points to the <code>sim_standalone</code> folder and uses the <code>sim-standalone-full.xml</code> file instead of <code>standalone</code> and <code>standalone-full.xml</code>).</p>
  
  <hr>
  
  <h2>My Question</h2>
  
  <p>The only issue I'm having now is that both <code>wildfly</code> and <code>sim-wildfly</code> are using the <code>JBOSS_HOME/bin/standalone.sh</code> file to run. This causes issues because <code>JBOSS_BASE_DIR</code> points to the <code>standalone</code> folder, causing the logs to overlap and the deployments to be read from that folder for both instances.</p>
  
  <p>My current solution is to create another <code>standalone.sh</code> file and change the <code>JBOSS_BASE_DIR</code> to the <code>sim_standalone</code> folder; however, I would like to know if there is a way to set <code>JBOSS_BASE_DIR</code> in one of my existing files without having to create another <code>standalone.sh</code> file. I tried setting it in <code>sim-wildfly.conf</code> since there are many other variables in there, but that didn't work.</p>
  
  <p>Any help would be appreciated!</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: So my <code>/etc/init.d/sim-wildfly</code> script runs <code>standalone.sh</code>. It sets the script by setting:</p>
  
  <pre><code>JBOSS_SCRIPT=$JBOSS_HOME/bin/standalone.sh
  </code></pre>
  
  <p>I'm trying to set it to: </p>
  
  <pre><code>JBOSS_SCRIPT=$JBOSS_HOME/bin/standalone.sh -Djboss.server.base.dir=$JBOSS_HOME/sim_standalone
  </code></pre>
  
  <p>...but that doesn't seem to be working. It says that <code>Djboss.server.base.dir=$JBOSS_HOME/sim_standalone</code> is not a file or directory when I run <code>systemctl status sim-wildfly</code>. I tried wrapping it in quotes as well. What am I missing?</p>