7 Replies Latest reply on Mar 15, 2002 3:33 AM by J. Wolfgang Kaltz

    Running in background on unix

    Gerard Smyth Newbie

      Soory if this is an obvious question, but my unix knowledge is quite limited!

      I am trying to work out how I can run the combined jboss and tomcat server in the background so that I can logout and leave it running.

      Currently I cannot log out of the system until I kill the server process, the terminal just waits and wont complete the logout.
      I have tried using nohup (ie nohup ./run_with_catalina.sh &), which seems from the man pages like it should help, but to no avail.

      I am using the jboss 2.4.3 and tomcat 4.0 download. Any help would be greatly appreciated!

      Cheers

      Gerard

        • 1. Re: Running in background on unix
          Adrian Brock Master

          You have many options.

          Look through the forums you will find standard unix
          solutions or java based solutions.

          Regards,
          Adrian

          • 2. Re: Running in background on unix
            Ron Jawanda Novice

            Why do you post stupid replies like this. He obviously knows to look around the forums. If YOU look around the forums you will find out that there aren't any discussions on this topic.
            Your reply doesn't do anyone any good. If you don't have a response that is usefull then don't post anything.
            Everyone here is trying to help each other.

            • 3. Re: Running in background on unix
              Ron Jawanda Novice

              You need to create a startup file.
              in /etc/init.d (depending upon your flavor of UNIX) you place can put a start/stop script. You need to write it in a particular way so that it truly starts and stops your services properly.
              Look at scripts in here... possibly the one that starts up dhcpd or syslogd or something like that.

              Make sure that try running them on the command line first and that they fork (or put a & on the executable).

              ie: prompt> dhcpd start
              prompt> dhcpd stop
              These should start and stop the dhcpd daemon.

              It isn't easy. You must look through your unix docs to try to figure it out unfortunately. I have some simple scripts that I can give you but I am not at my machine right now. If you want them I would send them to you. I will even create one for your combined server as I have to write one myself anyway.

              Post here and I will reply with the attachment.
              Ron

              • 4. Re: Running in background on unix
                Adrian Brock Master

                Sorry I was having a bad day :-)

                But I have discussed this many times in the past,
                for linux and windows. Can't find them using search as
                usual :-(

                I'll collect some of my observations from the past.

                I remember having problems myself with sysvinit resetting
                my path so it ended up trying to start jboss with kaffe.
                JBoss 3.0 contains a script for redhat but its not
                very standard shell.
                Here's an old link that appears when you search google
                for a more stand script.
                http://www.mail-archive.com/jboss-user@list.working-dogs.com/msg10908.html//www.mail-archive.com/jboss-user@list.working-dogs.com/msg10908.html
                There is also a recent modification to 3.0 to allow
                something called Alexandria to work.

                For windows users, cygwin provides a solution to
                run NT services. There's other commercial products,
                I've seen JService discussed in the past, sorry never
                tried it.

                Regards,
                Adrian

                • 5. Re: Running in background on unix
                  J. Wolfgang Kaltz Novice

                  I'm using the stand-alone JBoss, not the combined JBoss-tomcat, but it's probably quite similar.
                  In the standalone JBoss, all you need to do is edit the file bin/run.sh and change the "java" line to start Java in the background, for example as such:

                  java $HOTSPOT $JAXP -classpath $JBOSS_CLASSPATH org.jboss.Main $JBOSS_CONFIG $@ >>$STDOUT_LOG 2>$STDERR_LOG &

                  (where I previously set STDOUT_LOG and STDERR_LOG to point to my desired log files)

                  • 6. Re: Running in background on unix
                    Gerard Smyth Newbie

                    Thanks a lot for all your help!

                    I did try and look in the forums but I couldn't seem to find anything useful! I also had a lot of problems with search just returning a blank page :(

                    Anyway, I've used the last suggestion (as it seemed the simplest :) )and it seems to work, and continue running after I log out!

                    Thanks again.

                    Gerard

                    • 7. Re: Running in background on unix
                      J. Wolfgang Kaltz Novice

                      The misunderstanding about the "already been posted" stuff probably comes from the hardware crash jboss.org had a while back. It looks like many messages posted last year in the forums cannot actually be found anymore.