1 Reply Latest reply on Nov 18, 2003 6:45 PM by rickkw

    JBOSS, create process

    buggi

      Hi, i'm using jboss 3.0.6 and i'm trying to start a new process out of my web-app.

      I do this with the runtime.exec("/.../test.sh"). My problem is that the process is being killed when the server is shuting down.

      I tried to start the process with runtime.exec("nohup ...), but the process is also killed.

      Does anybody knows how to match this problem ?

        • 1. Re: JBOSS, create process

          Looking at the script you wanted to run, it looks like this is in a unix/linux environment. You can modify test.sh as a launcher instead of the actual process. test.sh can be used to spawn off a "detached" background process (not just a background process, but a detached process).

          A simple way is to use the unix 'at' command:

          test.sh
          -------------
          #!/bin/sh
          at now << EOF > /dev/null 2>&1
          #!/bin/sh
          # Put your commands here
          ls > /tmp/output.txt
          EOF
          -------------

          Note that if your commands generate output and if the output is not redirected to a file, the 'at' command will send you an email with the output. That can get annoying.