Are there any advantages using Java Service Wrapper over Supervisor or Systemd?

1.2k Views Asked by At

To run a java application as a service in background on a linux server there are plenty of possibilities. I could use the "Java Service Wrapper" by Tanuki or the open source fork "Yet Another Java Service Wrapper" or something I do not yet know about. I could use Supervisor or even Systemd.

My impression is that the Java Wrappers do not do anything more than run the application with the necessary options set (heap maximum size, maybe classpath and the like), monitor it, restart it if necessary or send signals to the application for reload, shutdown or restart. Things I think feasible easily with Supervisor as well as even with Systemd.

I tend to think that those wrappers where useful when linux init was still based on SystemV but are obsolete with the existence of supervisord or systemd. Are there some points I am missing at the moment?

Are there any advantages of special java wrappers over universal process control systems like supervisor or systemd?

1

There are 1 best solutions below

0
steinybot On

I have used the Java Service Wrapper from Tanuki Software at a past job and it worked really well for us. The main things we used it for were the controls scripts, JVM monitoring and triggered restarts and thread dumps. You can take a look at the full list of features.

In modern applications these could be partially covered by other tools such as build/packaging tools which can generate service and controls scripts, logs and metrics aggregation services, and health checks in automatic restarts in container engines. Making your application more resilient can also alleviate a lot of the issues.

That being said I still think it can be handy to have if you have an application which doesn't handle failures gracefully and needs a restart when it gets into a funny state.

I'm personally on the hunt to see what alternatives there are to reign in a troublesome monolith that I have inherited.