LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-17-2009, 09:15 AM   #1
Xerxes1121
LQ Newbie
 
Registered: Jun 2009
Posts: 7

Rep: Reputation: 1
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.
 
Old 12-17-2009, 04:26 PM   #2
kofucii
Member
 
Registered: May 2007
Location: Bulgaria
Distribution: Slackware, SCO Unix
Posts: 62

Rep: Reputation: 20
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 &
 
  


Reply

Tags
init, initd, java, service


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run a java application (server) as service fireball003 Linux - Newbie 8 04-08-2009 06:05 AM
Help please.. Network Servers stopped working after strarting Telnet service deanbrown3d Linux - Networking 1 06-16-2004 10:08 AM
java app as service SuperSadSmile Linux - General 2 12-31-2003 11:39 AM
java print service rno Linux - Hardware 0 10-06-2003 05:07 PM
Problem starting java service during bootup TomCruise2002 Linux - Newbie 0 01-29-2003 09:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration