Hi, I'm extremely new to Java and JBoss and need to find a solution for restarting crashed Jboss 6 EAP slaves (we use domain mode) on CentOS.
I found something called jsvc that is supposed to restart the slaves but our installation does not have it for some reason. with yum I was able to install apache-commons-daemon-jsvc but this did not seem to the thing that JBoss manual was describing?
Jboss 6 docs: 8.1.1. About Jsvc
Jsvc is a set of libraries and applications which allow Java applications run on UNIX and UNIX-like platforms as a background service. It allows an application to perform operations as a privileged user, and then switch identity to a non-privileged user. Jsvc uses three processes: a launcher process, a controller process and a controlled process. The controlled process is also the main Java thread. If the JVM crashes the controller process will restart it within 60 seconds. Jsvc is a daemon process and for JBoss EAP 6 it must be started by a privileged user.
Do I understand correctly that JBoss EAP 7 should do it automatically? As from the manual I see this description:
JBoss 7 manual: 8.1.3. About Process Controllers
A process controller is a small, lightweight process that is responsible for spawning the host controller process and monitoring its lifecycle. If the host controller crashes, the process controller will restart it. It also starts server processes as directed by the host controller; however, it will not automatically restart server processes that crash.
I don't know enough about that mechanism to tell you what to do in strictly JBoss terms, but if you're runnin CentOS 7 or later, you might be running your JBoss instances via systemd. The systemd facility has the ability to detect dead processes and restart them if the resource is defined with the appropriate options. While it's trickier to do with Java, it's not impossible.
Got idle CPU cycles? Join the war on COVID-19 by donating them to find the coronavirus' weak spots. folding@home Runs in the background. https://foldingathome.org
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat: