Failed to restart docker.service: Unit docker.service is masked

Posted: 1st June 2017 by admin in Uncategorized

Docker is not running \ You are ubable to start Docker Daemon:

root@penguin:~# sudo service docker restart
Failed to restart docker.service: Unit docker.service is masked.
root@penguin:~# docker –version
Docker version 1.12.6, build 78d1802

Sysctl shows the same output :

root@penguin:~# sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
Failed to enable unit: Unit file /etc/systemd/system/docker.service is masked.

Ok we see that service is masked  , it means below

mask is a stronger version of disable. Using disable all symlinks of the specified unit file are removed. If using mask the units will be linked to /dev/null. This will be displayed if you check e.g. by systemctl status halt.service. The advantage of mask is to prevent any kind of activation, even manual.

Ok so we need to unmask the docker service

root@penguin:~# systemctl unmask docker.service
Removed /etc/systemd/system/docker.service.
root@penguin:~# systemctl unmask docker.socket
root@penguin:~# systemctl start docker.service

Now everything should back to normal

root@penguin:~$ systemctl list-unit-files | grep docker
docker.service                             enabled  
docker.socket                              enabled  
root@penguin:~# docker ps -a
CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS                    PORTS               NAMES
61459d6cc36e        prakhar1989/static-site   "./"      12 weeks ago        Exited (0) 11 weeks ago                       static-site


  1. :) says:

    Great work!