Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6684

Incorrect handling of launch scripts directories when they are overriden with directories containing whitespaces in Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Scripts
    • None

      This issue is an old one, I guess nobody hit it because it is unusual to use directories with white spaces in Linux.

      The server launch scripts inspect the JAVA_OPTS and launch script arguments (SERVER_OPTS) to check whether the user is overriding jboss.server.base.dir, jboss.server.log.dir or 
      jboss.server.config.dir
       
      The calculation of these overrides is not correct when there are white spaces in those directories.
       
      For example:

      $WFLY_HOME/bin/standalone.sh -Djboss.server.log.dir=/tmp/log\ dir
      
      $ ps -fea | grep Standalone
      yborgess   41042   40904  6 12:18 pts/4    00:00:02 java -D[Standalone] -
      ...
      -Dorg.jboss.boot.log.file=/tmp/log/server.log
      ...
      -Djboss.server.log.dir=/tmp/log dir
      

      Notice the wrong calculation of org.jboss.boot.log.file which is set to "/tmp/log/server.log" instead of "/tmp/log\ dir/server.log"

       

      Things get worse if the override is the jboss.server.config.dir:

      -Djboss.server.base.dir=/tmp/copy\ standalone
      
      =========================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: /home/yborgess/dev/projects/wildfly-core/build/target/wildfly-core-24.0.0.Beta1-SNAPSHOT
      
        JAVA: java
      
        JAVA_OPTS:  -Djdk.serialFilter="maxbytes=10485760;maxdepth=128;maxarray=100000;maxrefs=300000" -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldaps=ALL-UNNAMED --add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Djava.security.manager=allow
      
      =========================================================================
      
      Unable to read the logging configuration from 'file:/tmp/copy/configuration/logging.properties' (java.io.FileNotFoundException: /tmp/copy/configuration/logging.properties (No such file or directory))
      java.lang.IllegalStateException: WFLYSRV0121: Configuration directory does not exist: /tmp/copy standalone/configuration
      	at org.jboss.as.server@24.0.0.Beta1-SNAPSHOT//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:409)
      	at org.jboss.as.server@24.0.0.Beta1-SNAPSHOT//org.jboss.as.server.Main.determineEnvironment(Main.java:406)
      	at org.jboss.as.server@24.0.0.Beta1-SNAPSHOT//org.jboss.as.server.Main.main(Main.java:80)
      	at org.jboss.modules.Module.run(Module.java:352)
      	at org.jboss.modules.Module.run(Module.java:320)
      	at org.jboss.modules.Main.main(Main.java:607)
      
      

      The main issue here is that the launch scripts are iterating over the JAVA_OPTS or SERVER_OPTS without taking into account possible whitespace.

              ssur@redhat.com Sudeshna Sur (Inactive)
              yborgess1@redhat.com Yeray Borges Santana
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: