1 Reply Latest reply on Jun 21, 2006 2:54 AM by veniamin

    Read-only environment setup

    veniamin

      Hi!

      Now I try to make JBoss run in read-only environment, where all JBoss run scripts and bootstrap libraries are placed in directory which is not writable. Wiki gave me two helpful pages: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossProperties and http://wiki.jboss.org/wiki/Wiki.jsp?page=LimitFilesJBossWritesToDisk, and they helped me somehow. I've moved $JBOSS_HOME/server/default/ to another directory in my $HOME and set "jboss.server.home.dir" property so it points to this configuration location, but still have a problem: not all files are searched in ${jboss.server.home.dir} directory. At the beginning of startup JBoss tries to invoke conf/jboss-service.xml, looking for it in $JBOSS_HOME/server/default/conf/ directory instead of ${jboss.server.home.dir}/conf/, thus failing to start its services (logging, deployment scanning and so on).
      Command I use to start JBoss:

      %JBOSS_HOME%\bin\run.bat -Djboss.server.base.dir=%JBOSS_PRIVATE_DIR%\jboss


      As you can see, I'm using Windows; %JBOSS_HOME% is an installation directory, %JBOSS_PRIVATE_DIR% is that directory which I want to hold all variable runtime files. Can JBoss anyhow run in such con where any disk write is made outside of its home, and also all configuration lives outside so I can change it? In other words, all subdirectories of $JBOSS_HOME will be read-only (on CD or read-only NFS for example), but configuration and deployment need to be writable.

        • 1. Re: Read-only environment setup
          veniamin

          Problem solved; first I was stupid, and second is I'm not sure. ;-)
          First.
          As I mentioned earlier, I run JBoss with this command line:

          %JBOSS_HOME%\bin\run.bat -Djboss.server.base.dir=%JBOSS_PRIVATE_DIR%\jboss

          Investigation showed me that run.bat don't pass its arguments to JVM under the hood, and even if it does, its arguments would be program arguments (JBoss' ones), not JVM's. To reach JVM, you need to set JAVA_OPTS env. variable so later run.bat can start JVM with their values. So far so good.
          Second.
          I thought that similar "-D" *.dir and *.url variables are mirroring their values to each other, for example jboss.server.base.dir and jboss.server.base.url, jboss.server.home.dir and jboss.server.home.url . I set jboss.server.base.dir and thought that its value will be used when running JBoss, as well as its *.url corresponding variable. boot.log's DEBUG level showed me that I was wrong. And when I set jboss.server.base.url to point to my writable directory, server has finally found jboss-service.xml and started well.