Docker service won't stop

When DietPi attempts to stop the Docker service it stops but immediately restarts. This affects dietpi-backup. Any ideas? Not sure what logs to check to help identify he cause.

does similar happen if you try to stop docker manually?

systemctl stop docker.service

Same behaviour, restarts immediately. I did notice when I stop it the following is displayed:

Warning: Stopping docker.service, but it can still be activated by: docker.socket

Docker was installed with dietpi-software.

Usually this should be working as we had user who were surprised that our backup is going to stop Docker. :wink: As well the notification should not have any impact. It’s the same on my system where Docker stops correctly.

Can you test following and share the output from logs afterwards.

reboot
systemctl stop docker.service
journalctl -u docker.service

I will do. When I run systemctl status docker after the automatic restart I can see it has been triggered by docker.socket.

Maybe one of your container is preventing the service stop? Or do you have something that tries the connect to the socket? Because this could restart the engine service as well.

You’re right, I have both watchtower and portainer running with docker.sock passed through. I’ve had these running for years though and this has only started happening recently - can’t say when exactly.

Portainer should not be an issue as it is a container that should be stopped as well during Docker service stop. At least I would expect this. Watchtower I have no experience as I never used it.

Theoretically you could stop one of them manually before stopping Docker service to check what happens. On a next try, stop the other one.

I’ve tried the combinations. Either one of them running is enough to cause the behaviour. ie portainer running alone or watchtower running alone, docker service will not stop.

Maybe some new “feature” within recent Docker version :thinking: