I have a custom Java application running on my RHEL machine. I am running this Java application from a bash exec script with all the parameters and options appended. As a result, my Java application gets a generic name "java" in the system processes which is not useful for me as I would like to apply monitoring for this process (to know when it crashed or not) and the name is not unique, as well as I would potentially like to deploy another similar Java application, therefore I will not be able to distinguish them.
How to give my Java application a specific unique name?
Example from top below...
pid_no user 20 0 other_info java
pid_no user 20 0 other_info java
pid_no user 20 0 other_info java
Ideally I would like to have...
pid_no user 20 0 other_info my_app1
pid_no user 20 0 other_info my_app2
pid_no user 20 0 other_info my_app3
Thank you in advance.
It seems like you have maybe two relatively simple options -
For Example:
For example:
If your goal is to monitor the application, consider something like jvmtop or simply have the app write to a heartbeat log, and monitor that.