-
-
Save zenthangplus/4b2d534fa85031ae6c652ffe16ae5da2 to your computer and use it in GitHub Desktop.
| #!/usr/bin/env bash | |
| # Error example: | |
| # ERROR: for redis cannot stop container: 16028f9: | |
| # Cannot kill container 16028f9: unknown error after kill: docker-runc did not terminate sucessfully: | |
| # container_linux.go:393: signaling init process caused "permission denied" | |
| # | |
| # This error was caused by AppArmor service in Ubuntu | |
| # It was not working normally due to some unknown issues. | |
| # Run following commands to fix it. | |
| # Check AppArmor status | |
| sudo aa-status | |
| # Shutdown apparmor and prevent it from restarting | |
| sudo systemctl disable apparmor.service --now | |
| # Unload AppArmor profiles | |
| sudo service apparmor teardown | |
| # Re-check AppArmor status | |
| sudo aa-status | |
| # Try to re-stop containers | |
| docker-compose down |
This works for me. Thank you @zenthangplus
sudo service apparmor teardown
Result :: Usage: /etc/init.d/apparmor {start|stop|restart|reload|force-reload|status}
Can you guys help?
Thank you
@albertosetim Restart would be sufficient and easiest
I guess this solution needs to update.
In my case, there is no teardown command of apparmor service. And stop the service doesn't help.
There are still a lot of "snap.docker.dockerd" processes in the output of aa-status, and it seems that only aa-remove-unknown can get rid of them and make stopping docker containers possible. Learned it here: https://javahowtos.com/guides/124-docker/414-solved-cannot-kill-docker-container-permission-denied.html
@zenthangplus worked for me, thanks!
Thanks @panzy that link- this worked for me
Excelent it worked for me!