I have installed GeoSerer running with Jetty. I use monit to monitor GeoServer is running or not and I need pid in the process.
Anyone can tell me how to do that?
I have installed GeoSerer running with Jetty. I use monit to monitor GeoServer is running or not and I need pid in the process.
Anyone can tell me how to do that?
supposing you are using the default startup/shutdown scripts, the quick and dirty way is:
(i just grepped for a pattern that should match only the process I am interested in but you may get weird results if the pattern matches something else as well)
the correct way is to wrap the startup/shutdown scripts into a init script that will save the pid somewhere in the file system cuz as we can notice the java dudes don't really care about providing good service management scripts.
startup script (very simplified):
shutdown script (very simplified):
you can get the pid of the process with
like this:
or like this: