Linux-Noob Forums

Full Version: simple pkill question...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does Pkill just end the service.. or does it actually restart it as well? I have used the command in this way Pkill -9 java to restart java... but what happens if I do not append java with the -9? I'm working on a live phoneswitch running Redhat and figured asking would be better than just doing to find out. Thanks a lot.

pkill kills a process


the process you killed probably has a daemon which restarts itself once stopped *or killled*




So pkill itself isn't doing the restarting, the daemon is probably bringing the process back up once it detects that it is not running.

Quote:Pkill -9 java
You may want to refrain from the "-9" option: just pkill java will do the trick.


It may take longer for the java processes to stop, but they'll have a chance to shut down cleanly (and allow the OS to reclaim used memory, file handlers, etc)