LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Java servers as a service (https://www.linuxquestions.org/questions/linux-general-1/java-servers-as-a-service-776432/)

Xerxes1121 12-17-2009 09:15 AM

Java servers as a service
 
I have a Java based RuneScape server that I have been running under Windows for some time now without issue. At one point I decided to migrate the server over to my linux box, and it worked perfectly, accept for the fact that I only have SSH to manage the server, and I need two SSH windows open to get the server to run. This is because the server is comprised of two separate programs, one to run the server itself, and one to manage the database.

I was thinking it would be possible to run both of the programs as a service. I tried to configure them in init.d but I had no luck there. I understand the concept behind the init.d scripts but I just can't seem to get the code right.

The command to start the server(s) are

Code:

ant /etc/rscd/runls
AND

Code:

ant /etc/rscd/runserver
I also tried running them with the daemon program, but no luck there either.

Both servers use apache ant to run. If somebody could enlighten me on how to run these programs as services I would be really happy.

Thanks in advance.

kofucii 12-17-2009 04:26 PM

First when, you starting them by hand, you could append "&" at the end like this:
Code:

# ant /etc/rscd/runls &
# ant /etc/rscd/runserver &

This way, the process will run in background and you coul use your console.

For how to start them as a service, look for file "rc.local", somewhere in /etc:

Code:

# cd /etc
# find . | grep rc.local

You have not point your linux distro, so there may not be such a file. but ig you do then add this in It:

Code:

exec <full path to ant>/ant /etc/rscd/runls &
exec <full path to ant>/ant /etc/rscd/runserver &



All times are GMT -5. The time now is 12:49 AM.