Krishna Manohar
Krishna Manohar

Reputation: 300

failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

I start docker

sudo service docker start

then I try to run dockerd

sudo dockerd

it shows the following error:

INFO[2021-11-21T19:25:52.804962676+05:30] Starting up
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

Upvotes: 12

Views: 64184

Answers (8)

I got this problem, and this is my resolve:

  1. the problem: docker is hang, even i try to stop with:
sudo systemctl stop docker
  1. then i try to debug with:
sudo dockerd --debug

showing:

INFO[2024-01-06T09:49:56.628001335-05:00] Starting up                                  
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
  1. and try to remove the pid file with:
rm /var/run/docker.pid

it should be fix your problem

Upvotes: 3

Matt
Matt

Reputation: 223

In my case, I ran sudo service docker stop and it did the trick.

Upvotes: 0

being01amit
being01amit

Reputation: 19

If you're trying to start docker pid and getting this error:-

INFO[2023-05-03T12:13:55.369754816+05:30] Starting up failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

systemctl stop docker

After that just delete the docker.pid file

rm /var/run/docker.pid

And then just run sudo dockerd and you good to go

Upvotes: 0

Ganapathiraj
Ganapathiraj

Reputation: 151

Delete the .pid file using the below Linux command,

rm /var/run/docker.pid

Now the pid file will get deleted and the docker daemon can be launched newly.

Upvotes: 15

Boodle
Boodle

Reputation: 73

Had similar issue
`sudo docker ps -a` 

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

sudo systemctl status docker

docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: deactivating (stop-sigterm) since Wed 2022-09-07 09:32:11 -05; 5h 55min ago Docs: https://docs.docker.com Main PID: <PID_NO> (dockerd) CGroup: /system.slice/docker.service └─<PID_NO> /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

 time="2022-09-07T09:32:26.-05:00" level=info msg="ccResol...=grpc
 time="2022-09-07T09:32:26.-05:00" level=info msg="ClientC...=grpc
 time="2022-09-07T09:32:26.-05:00" level=info msg="pickfir...=grpc
 time="2022-09-07T09:32:26.-05:00" level=info msg="pickfir...=grpc
 time="2022-09-07T09:32:26.-05:00" level=info msg="[graphd...lay2"
 time="2022-09-07T09:32:26.-05:00" level=warning msg="moun...ound"
 time="2022-09-07T09:32:26.-05:00" level=info msg="Loading...art."
systemd[1]: Dependency failed for Docker Application Container Engine.
systemd[1]: Job docker.service/start failed with result 'dependency'.
dockerd[<PID_NO>]: time="2022-09-07T09:39:52.-05:00" level=info msg="Process...ted'"
Hint: Some lines were ellipsized, use -l to show in full.


 
`sudo systemctl start docker`  -- Gives no output 

deleted docker.pid file in var/run but It didn't helped either

Upvotes: 1

carl
carl

Reputation: 11

I had the same problem. The following worked for me:

  1. Deleted /var/run/docker.pid
  2. Reboot computer

Upvotes: 1

GP Singh
GP Singh

Reputation: 716

Delete the PID file. Kill the running docker service and start it again.

ps -ef | grep docker
kill -9 <PIDs>
sudo systemctl start docker.service

Upvotes: 2

Krishna Manohar
Krishna Manohar

Reputation: 300

it works for me:

sudo chmod 666 /var/run/docker.sock

Upvotes: 4

Related Questions