I enabled docker container
to restart automatically during crashes/system reboots etc.
For this we applied the docker restart policy to always
for an already running container .
Sent a SIGHUP
signal but the container
did not stated automatically
sudo docker kill --signal=SIGHUP 5b61a7735329
5b61a7735329
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
On restarting the docker container
using below command , the container process starts automatically as verified by docker ps
$ sudo systemctl restart docker
SIGHUP
signal.always: Always restart a stopped container unless the container was stopped explicitly
You stopped it with docker kill. You should use "on-failure". SIGHUP is not a normal exit and should trigger a restart.
on-failure: Restart the container if it exited with a non-zero exit code or if the docker daemon restarts
...