Hi, we've got an application module that needs to be restarted every morning (it's a workaround until we get a fixpack).
We've done a script that looks for its PID (by doing a ps -ef | grep $module | grep -v grep), kills it and then restarts it.
The problem is that now we're installing more modules, with similar names, so we're having troubles to identify exactly the PID of the module we want.
I'd like to know if it's possible to get the PID when the script starts the module. This way I could save the PID in a file, so the next time we wouldn't need to make the ps -ef, we would just read the PID from the file.
Is there a way to know the PID when we run the command?
This is the way we start the application module in the script (given to us by the vendor):
What I'd like to do is to get the PID when the script runs this command, is it possible?
Thanks
We've done a script that looks for its PID (by doing a ps -ef | grep $module | grep -v grep), kills it and then restarts it.
The problem is that now we're installing more modules, with similar names, so we're having troubles to identify exactly the PID of the module we want.
I'd like to know if it's possible to get the PID when the script starts the module. This way I could save the PID in a file, so the next time we wouldn't need to make the ps -ef, we would just read the PID from the file.
Is there a way to know the PID when we run the command?
This is the way we start the application module in the script (given to us by the vendor):
Code:
nohup /path/to/exec args 1>/dev/null 2&1 &
What I'd like to do is to get the PID when the script runs this command, is it possible?
Thanks