In Groovy, is there a way to check if the program is still running by using the PID?
Asked
Active
Viewed 1,425 times
2 Answers
1
You can use kill command with 0 signal. Sample code in Groovy:
"kill -0 ${pid}".execute().waitFor()
0 as a returned value means the process is still running.
Community
- 1
- 1
Marcin Zajączkowski
- 4,036
- 1
- 32
- 41
0
yes there is a way to check if the program running ,To check for the existence of a process, use
kill -0 $PID
Ferrakkem Bhuiyan
- 2,741
- 2
- 22
- 38