Restart workers
To restart workers, use the following commands from inside an SSH session.
sv stop app / systemctl --user stop app
sv start app / systemctl --user start app
The command is dependent on whether the service is based on our runit based or newer systemd based images.
Stop workers
To stop a worker during a deployment, connect via SSH and send a Signal terminate (SIGTERM) to terminate the process.
List all processes running and locate the worker to terminate:
ps -fauxw
Once you located the process to terminate, and it's process ID (PID) You can use the following command to send a SIGTERM:
kill <PID>
This command allows your worker to pause it's work, especially when it's a worker that cannot stop its process mid-task.
If, however, the worker does not respond after 15 seconds, allow the Container to be shut down and restarted by sending a Signal kill (SIGKILL):
kill -9 <PID>