I am wondering if we can stop a Single JVM within specific time limit. If it is not stopping within that time limit then kill the process from shell script.
If we are executing ./stopServer.sh JVM_Name - It will run till the jvm will not get stopped or till any error and exit.
What I am trying to do is :./stopServer.sh JVM_Name - If this do not stopped within 2 min(suppose), then kill the process (But How to figure out it is not stopped within 2 mins through shell script before the process go for killing). I can write the condition to kill . But not sure how to do checks if the JVM stopped within 2 mins or not so that we can go ahead to kill process.
Can anyone please suggest shell script code to identify if the jvm is stopped within specific time limit or not?