How to safely stop the openfire process

Hi,

We’re developing a plugin for Openfire and we reguarly use the ant “run” target in Eclipse to start the openfire server. Is there a way to safely close stop this process in Linux (Ubuntu 9.10) without having to open the System Monitor, find the Java process that relates to openfire (sometimes there are may java process for different applications, such as Eclipse) then manual stop that process?

It would be good to have an Ant “stop” target. The prebuilt distribution comes with an opefire script in the bin folder which can be used to start or stop the openfire service. If you build from the source you do not get anything with similar functionality (openfire.sh only starts the server, it can’t be used to stop it).

Any ideas would be appreciated.

Cheers,

Daniel.

I have managed to create a Linux command that will search for and kill only the Openfire java process, and leave other java processes alone:

ps aux | grep “/openfire/” | grep -v grep | awk ‘{ print $2; }’ | xargs -i kill {}

It would still be good to have a target in the Ant buildfile which would work on all systems.