jsvcapache-commons-daemon

Is jsvc supposed to restart a program which stops because of an uncaught exception


I am using commons-daemon-1.0.15 and Ubuntu 14.04.

I followed the tutorial here: http://www.neilson.co.za/creating-a-java-daemon-system-service-for-debian-using-apache-commons-jsvc/

In my program I generate a runtime-exception which is caught by the catch-all handler. This handler exits the program with code code 1.

However, jsvc does not restart the program.

Is jsvc supposed to restart a program which exits with a non-zero code.

Thanks!


Solution

  • I found the solution,

    My catch-all handler should exit with code 123. That causes jsvc to restart the jvm