3 Replies Latest reply on Oct 23, 2012 3:09 AM by Rico Neubauer

    Working directory for server processes not configurable

    Rico Neubauer Novice

      Hi,

       

      Currently there seems no configuration option to set the working directory of the server-process(es).

      Host- and domain-controller both use system-property "user.dir", but for the server-process in org.jboss.as.host.controller.ManagedServer.ProcessAddTask#execute() the following is used to initiate the new process:

       

      processControllerClient.addProcess(serverProcessName, authKey, command.toArray(new String[command.size()]), environment.getHomeDir().getAbsolutePath(), env);

      where environment.getHomeDir().getAbsolutePath() donates the working directory for the new process.

       

      I tested JBoss with changed working directory and this seems not to introduce any issue, so I would request this becomming a configuration option.

      Do you agree/disagree and should I open a JIRA for it?

       

      Also see this discussion of one of my colleagues for general thoughts regarding the working directory: https://community.jboss.org/thread/203368.

       

      Best Regards,

      Rico

        • 1. Re: Working directory for server processes not configurable
          Brian Stansberry Master

          This is a valid feature request. Please go ahead and open a JIRA.

          • 2. Re: Working directory for server processes not configurable
            Stephen Coy Master

            I know that in standalone mode it's possible to set the following system properties:

             

            • org.jboss.boot.log.file
            • jboss.server.log.dir
            • jboss.server.temp.dir
            • jboss.server.data.dir
            • jboss.server.config.dir

             

            We make use of this in our embedded solution. Can you see if these or similar are added to the "env" parameter of the addProcess call above?

            • 3. Re: Working directory for server processes not configurable
              Rico Neubauer Novice

              No, the 'env' variable does not hold these values, but those are contained in the 'command'. This is an example:

              C:\jboss\runtime\jvm64\bin\java, -D[Server:server-one], (some more JAVA OPTS) -D[Host Controller]=true, -Dsun.rmi.dgc.client.gcInterval=3600000, -Dorg.jboss.resolver.warning=true, -Dsun.rmi.dgc.server.gcInterval=3600000,
              -Djboss.host.default.config=host.xml, -Djboss.modules.system.pkgs=org.jboss.byteman, -Djboss.home.dir=C:\jboss, -Djboss.domain.default.config=domain.xml, -Djava.net.preferIPv4Stack=true,
              -Djboss.server.log.dir=C:\jboss\domain\servers\server-one\log, -Djboss.server.temp.dir=C:\jboss\domain\servers\server-one\tmp, -Djboss.server.data.dir=C:\jboss\domain\servers\server-one\data,
              -Dorg.jboss.boot.log.file=C:\jboss\domain\servers\server-one\log\boot.log, -Dlogging.configuration=file:C:\jboss\domain/configuration/logging.properties, -jar, C:\jboss\jboss-modules.jar, -mp, C:\jboss\modules,
              -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.server
              

               

              Anyhow, none of these is used as working directory, so doesn't help here.

               

              Feature request: https://issues.jboss.org/browse/AS7-5813