Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graceful-kill-java.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ REM WMIC PROCESS where "Name='JAVA.EXE' AND COMMANDLINE LIKE '%%NodeDaemon.poolN

REM argument of 300000 will wait 5 minutes for graceful shutdown, then force kill.
ECHO This will execute the following wmic command:
ECHO wmic process where "caption like 'java.exe' and commandline like '%%%1%%'" get processid
ECHO wmic process where "caption like 'java%%.exe' and commandline like '%%%1%%'" get processid
ECHO Then load the agentjar in each process to start graceful shutdown.
echo java -cp %JAVA_HOME%\lib\tools.jar;%RUNFILE% com.jda.gracefulkilljava.GracefulKill %AGENTFILE% %1 300000
%JAVA_HOME%\bin\java -cp %JAVA_HOME%\lib\tools.jar;%RUNFILE% com.jda.gracefulkilljava.GracefulKill %AGENTFILE% %1 300000
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jda/gracefulkilljava/GracefulKill.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void main(String[] args) throws IOException {
HashSet<String> doNotKill = getPidForGracefulKill(output);

//The PIDs for the JVMs that the user is searching for.
output = getProcessResults("wmic process where \"caption like 'java.exe' and commandline like '%"+commandSubstring+"%'\" get processid");
output = getProcessResults("wmic process where \"caption like 'java%.exe' and commandline like '%"+commandSubstring+"%'\" get processid");
//int skip=2;
int skip=1;
String[] splitResults = output.split("[' ']+");
Expand Down