Can't Kill Docker Main Process
You want the systemctl
command, not sysctl
.
systemctl stop docker
If you want to stop it from starting at boot:
systemctl disable docker
Related videos on Youtube
NonCreature0714
Software Engineer. Passionate about Open Source. Love Docker, Swift, Python, Rust, Raspberry Pi, Angular, iOS, and Unity3d.
Updated on September 18, 2022Comments
-
NonCreature0714 over 1 year
How do I kill the docker main process? Why does it keep crashing?
I have docker installed on Ubuntu (on AWS).
I started a cluster the other day, and let it run over night. (It appeared to start with no issues.)
Returning the next day, I did a
docker ps
:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
So I
tail -f /var/log/syslog
:Jul 14 11:25:20 server01 kernel: [8107974.094867] init: docker main process (23915) terminated with status 1 Jul 14 11:25:20 server01 kernel: [8107974.094876] init: docker main process ended, respawning Jul 14 11:25:21 server01 kernel: [8107975.451554] init: docker main process (23961) terminated with status 1 Jul 14 11:25:21 server01 kernel: [8107975.451564] init: docker main process ended, respawning
And the syslog looks like this, for hours.
And so I try
me@server01:~$ sudo sysctl docker stop
:sysctl: cannot stat /proc/sys/docker: No such file or directory sysctl: cannot stat /proc/sys/stop: No such file or directory
Then I try
me@server01:~$ sudo service docker stop
:docker stop/waiting
Then
sudo service docker start
:docker start/running, process 11150
And
tail -f /var/log/syslog
:Jul 14 11:35:13 server01 kernel: [8108567.403154] init: docker main process (11082) terminated with status 1 Jul 14 11:36:46 server01 kernel: [8108660.693572] init: docker main process (11150) terminated with status 1 Jul 14 11:36:46 server01 kernel: [8108660.693581] init: docker main process ended, respawning Jul 14 11:36:48 server01 kernel: [8108662.068454] init: docker main process (11200) terminated with status 1 Jul 14 11:36:48 server01 kernel: [8108662.068463] init: docker main process ended, respawning
Thinking myself clever, I
sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
then...sudo kill -SIGUSR1 $(cat /var/run/docker.pid) sudo kill -SIGUSR1 $(cat /var/run/docker.pid) sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
Just for good measure... and yet:
me@server01:~$ tail -f /var/log/syslog Jul 14 11:56:07 server01 kernel: [8109821.948151] init: docker main process (17416) terminated with status 1 Jul 14 11:56:07 server01 kernel: [8109821.948160] init: docker main process ended, respawning Jul 14 11:56:09 server01 kernel: [8109823.340658] init: docker main process (17469) terminated with status 1 Jul 14 11:56:09 server01 kernel: [8109823.340666] init: docker main process ended, respawning
And so forth... So I'm back to where I began.
Unfortunately,
systemctl: command not found
docker run hello-world
:docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
-
NonCreature0714 almost 7 yearsUnfortunately
systemctl: command not found
-
Deathgrip almost 7 yearsWhat version of Ubuntu? You may also want to add the line
DOCKER_OPTS="--debug=true --log-level=debug
to/etc/default/docker
. -
NonCreature0714 almost 7 yearsNot entirely sure, but uname -a outputs:
Linux server 3.13.0-91-generic #138-Ubuntu SMP Fri Jun 24 17:00:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
-
Deathgrip almost 7 years
lsb_release -a
orcat /etc/os-release
orcat /etc/lsb-release
. -
NonCreature0714 almost 7 yearsExcuse me, lsb_release -a tells me it's 14.04.5 LTS
-
NonCreature0714 almost 7 yearsAnd I went ahead and edited
/etc/default/docker
like you recommended -
Deathgrip almost 7 yearsIt's using Upstart. Try
initctl stop docker
, although that ends up being executed when you doservice docker stop
. To disable at boot,echo "manual" >> /etc/init/docker.override
. Once you start it again, hopefully there are debug messages in/var/log/syslog
that lead you to why the process is/was constantly respawning.