4

I am using Jsvc to start a java program that implements the Daemon interface. However when I issue the command

/usr/bin/jsvc -user walikha -home $JAVE_HOME -outfile out.file -errfile '$1'   Jooist.Server.jar Main

However the command silently executes and displays the prompt. How can I detect if the daemon is running? In the Java executable the init, start, stop and destroy functions just print to a log file using Log4J. The log file is not created and there is absolutely no indication that the service is running. Am I missing something, or have I left out something when configuring and installing Jsvc?

Waliaula Makokha
  • 815
  • 1
  • 11
  • 21

3 Answers3

1

Modify your command to include options "-outfile" and "-errfile" and provide your own path to the log files.

/usr/bin/jsvc -outfile app.out -errfile app.err -user walikha -home $JAVE_HOME -outfile out.file -errfile '$1'   Jooist.Server.jar Main
Chander Shivdasani
  • 9,878
  • 20
  • 76
  • 107
0

Try the -debug switch and see what's going on. However, it looks like you've missed including commons-daemon-1.0.10.jar in your classpath.

Muhammad Gelbana
  • 3,890
  • 3
  • 43
  • 81
0

You can start a service as daemon by adding your application in /etc/init.d/ start/stop scripts.

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Dheeraj Joshi
  • 3,057
  • 8
  • 38
  • 55