Tuesday, June 25, 2019

bash - Shell script Process PID logging and maintenance using exec

I am trying to launch a java process as a server and then might periodically need to restart/kill it at certain times. Since I use a shell script to launch java jvm(to build classpath), I thought of logging the shell script process id using $$ and then run java as
"exec java" so that I can use the logged process id for killing the process and launching the new jvm.
Is that the best way to do it? Any feedback?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...