Ritu
Ritu

Reputation: 1105

Starting a service from tomcat in Linux

I am making a GUI in Java, which starts and stops services. I am using the following code to start the service:

Runtime runtime = Runtime.getRuntime();
Process exec = runtime.exec(serviceExecutablePath);

where serviceExecutablePath is

nohup /usr/local/Services/Deployable/AccountNameCleanServiceJar/AccountNameCleanService.sh >/dev/null

I am using Tomcat as my server. Every time I start a service it gets started but after some time stops by itself.

However on running the same command from Unix console its running fine. I am stuck why this is happening, can anyone help me in this?

Upvotes: 1

Views: 223

Answers (1)

Sietse van der Molen
Sietse van der Molen

Reputation: 705

Did you look at Apache's jsvc?

Upvotes: 1

Related Questions