This tip is shows you how to safely shut down the Iguana service daemon using a terminal window, and also tells you what to avoid.
Shutdown the Iguana daemon safely according to our best practice.
To stop this daemon gracefully:
- Open a terminal window.
- Run this command:
- If and only if the daemon has hung (does not stop for SIGTERM) then you can force kill Iguana as a last resort:
- Run the kill-9 command:
- This will kill the Iguana process (stop it immediately) without allowing it to perform cleanup.
- If your Iguana does not restart correctly you will need to reboot the Server to clean up Iguana memory issues caused by the forced shutdown
Note: The only recommended way to kill the Iguana daemon is by using the SIGTERM signal option as it allows the processes to shutdown cleanly.
Using any other option (like kill -9) may result in improper Iguana shutdown.
How it works [top]
Windows has many ways that you can manage processes:
- The Services Manager (GUI) application
net startcommand — that you run in a command window
- The taskkill command — that you run in a command window
- The Task Manager (GUI) application
- The Stop-Service command — that you run in a powershell window
- The sysinternals Process Explorer (a free Microsoft utility)
All of these methods will allow you to stop a process gracefully. Most of them (other than the first two) also allow you to force stop a process or process tree.
Gracefully (safely) stopping a process:
What does this actually mean? It means that you “politely” ask the process to stop which allows it to perform cleanup before closing. This means it will wait for external processes (like web services and databases) to return results before it will shut down. Unfortunately this also means that sometimes a process will freeze or “hang” if something goes wrong, for example waiting for a database connection (or web service) that never returns a result is common cause of a frozen process.
This is the recommended way to shut down a service or process.
Force stopping a process:
What does this actually mean? It means that you “rudely” force the process to stop and do not allow it to perform cleanup before closing. This means it will not wait for external processes (like web services and databases) to return results before it shuts down. Unfortunately because cleanup is not performed it can leave various “artifacts” like, unreclaimed memory (a so called memory leak), zombie processes (child processes not shutdown), unclosed connections, etc.
This method of shutting down a daemon or process should only be used as a last resort for frozen (“hung”) processes.
How the killall and kill commands work:
killall command kills all instances of a given process identified by the specified name (one or more processes can correspond to the given name). The
kill command kills a single process identified by the specified process id. You should always use the SIGTERM signal option as it allows the processes to shutdown cleanly.
Shown below are some more common kill/killal signals:
|Signal name||Signal value||Effect|
|SIGINT||2||Interrupt from keyboard|
|SIGSTOP||17,19,23||Stop the process|
Warning: Only use
kill -9 PID command (SIGKILL signal) as a last resort because it can result in improper shutdown. Force killing in this way is how we start running into problems with Iguana not shutting down properly.
If you do use ‘kill -9 PID’ and Iguana does not restart you may need to reboot the server (to clean up memory issues from incorrect Iguana shutdown).