linux - RHEL Java application - specific name instead of generic java process -


i have custom java application running on rhel machine. running java application bash exec script parameters , options appended. result, java application gets generic name "java" in system processes not useful me apply monitoring process (to know when crashed or not) , name not unique, potentially deploy similar java application, therefore not able distinguish them.

how give java application specific unique name?

example 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 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 in advance.

it seems have maybe 2 relatively simple options -

  1. create soft link java "desired" application name, , start app that

for example:

ln -s /usr/bin/java /usr/bin/yourapp /usr/bin/yourapp {options} yourapp.class ps -ef |grep yourapp 
  1. pass dummy parameter application @ start identifies app.

for example:

java {options} -dyourapp="yourapp" yourapp.class ps -ef |grep yourapp 

if goal monitor application, consider jvmtop or have app write heartbeat log, , monitor that.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -