Solved

LINUX - run java -jar apex.war as service

Posted on 2013-05-30
6
717 Views
Last Modified: 2013-06-21
Hi,

What's the command to run a commandline app as a service?

run this from commandline
java -jar apex.war standalone --port 7778 --apex-images /home/mont/apex/images

it starts listening to port 7778

so I want to it to run as a service on the server..

thanks, Bill
0
Comment
Question by:bcarlis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 35

Expert Comment

by:johnsone
ID: 39209148
Did you try searching for an answer?  This link seems to have the necessary steps:

http://www.unix.com/unix-dummies-questions-answers/34641-making-script-start-service.html
0
 
LVL 2

Author Comment

by:bcarlis
ID: 39209309
Yes,

But I wouldn't have seen that one as an answer because it has no solution that worked and I would need an example for the shell script calling the java command.
0
 
LVL 29

Accepted Solution

by:
serialband earned 500 total points
ID: 39209403
Here's a Debian example with a sample line of java script that you could use.

http://www.ralfebert.de/blog/java/debian_daemon/


If you're unsure of how to create a standard init script, maybe you should try the java service wrapper.

http://wrapper.tanukisoftware.com/doc/english/download.jsp
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 35

Expert Comment

by:johnsone
ID: 39209644
The second comment in the link that I posted has the solution.  You need to put the command you have into the start section of the script.
0
 
LVL 2

Author Comment

by:bcarlis
ID: 39212267
what about the
$nohup java -jar apex.war

that starts in the background but it won't restart with a restart on server right?

so first comment in the second post looks like one to try..
0
 
LVL 35

Expert Comment

by:johnsone
ID: 39212682
Correct.  If you use nohup and drop it in the background it will not restart with a system restart.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question