Docker Community Forums

Share and learn in the Docker community.

Httpd already running


(Paniez46) #1

Hi,

I use Docker on Ubuntu 16.04 to have a container with Apache.

All worked fine since yesterday and my container stop this morning. When I try to start again, I have an error :

httpd (pid 8) already running

I restart docker, but nothing changes (no httpd pid is present)

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64
Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64
 Experimental: false

I have this error with docker status : Couldn't run auplink before unmount /var/lib/docker/aufs/mnt/..... segmentation fault (core dumped).

I install cgroup-lite and I have already aufs-tools package, but nothing changes. I try with official CE edition (a little bit older v. 17.03.1-ce), but nothing changes.
I already stop and start this container before, but now, it doesn’t want start again.

EDIT1 : I stop this container and make a docker run ... to have a new container from my image and I have the same result.

EDIT2 : When I go in /var/lib/docker/aufs/mnt/, I have some directories. The only which has something (a core file) is directory in my error : /var/lib/docker/aufs/mnt/6a32630585211a651c406794ad20e7965c59318ea65d485855b8d7925b9f6e40

Thanks


(Nbonniot) #2

Hello,
I ran into the same issue. This is because /var/run/apache2.pid is existing on Apache container up, and also I suspect you only use docker stop to stop your containers (whereas a docker-compose down is closer to Docker philosophy in here, because all persistant data should lie within a mapped volume). So, container is basically reused as is on start/stop processes. If it crashed on something similar, it will not restart with this PID story.
2 solutions for me :

  • Exclusively docker-compose down when stopping.

  • Modifying Apache Dockerfile image to add :

    #Ensure old PID due to previous usage are killed
    RUN rm -f /var/run/apache2/apache2.pid

Very last solution is actually setup in php official image.