Docker Community Forums

Share and learn in the Docker community.

Httpd (pid 8) already running.- Container logs error

(Hrishidocker) #1

Hi Guys,

Last week my docker server got rebooted abruptly affecting only one container out of 8.
the container is in exited stated and it’s not starting.

I checked the logs of container and have found below error :
httpd (pid 8) already running

Please suggest how to start the container without losing any data.

(Nitishmowall) #2

Hey @hrishidocker
so when container is restarting, it is trying to start service(httpd) inside it. But since it has old pid still exists( that usually happens when service exits abruptly), it abort(fails) the starting operation. And i think you are running httpd service as 1st process in container. So it fails means container exits. So you have to make sure to add in the CMD( or ENTRYPOINT) script to properly remove old pid then start the service, which you can only do by creating the new image and creating new service

you can try restarting it multiple time hope that it remove the old pid. But chances of happening is low.