From: robert <robert@redcor.ch>
To: Mariel Cherkassky <mariel.cherkassky@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: container restarted -> postgresql dead but pid file exists
Date: Sun, 12 Jan 2020 12:41:44 +0100
Message-ID: <bee8846a-f902-c7fe-33f5-24aa187e256b@redcor.ch> (raw)
In-Reply-To: <CA+t6e1kX0jBeG2mdBa2ocLnK+xFLM+vE+pJ-RHVYi6V6_A-JBQ@mail.gmail.com>
References: <CA+t6e1kX0jBeG2mdBa2ocLnK+xFLM+vE+pJ-RHVYi6V6_A-JBQ@mail.gmail.com>
could it be, that this pid exist from "before" the update?
you can "enter" a running container as user root executing:
docker exec YOURCONTAINERNAME bash
then ls -l /run/postgresql
when I do that "outside" of a container (in a running ununtu box) I get:
robert@lappi:~/projects/fernuni13/fernuni13/fernuni$ ll /run/postgresql/
total 8
drwxrwsr-x 3 postgres postgres 120 Jan 8 10:57 ./
drwxr-xr-x 37 root root 1240 Jan 12 11:50 ../
drwxr-s--- 2 postgres postgres 200 Jan 12 12:35 11-main.pg_stat_tmp/
-rw-r--r-- 1 postgres postgres 5 Jan 8 10:57 11-main.pid
srwxrwxrwx 1 postgres postgres 0 Jan 12 11:50 .s.PGSQL.5432=
-rw------- 1 postgres postgres 69 Jan 12 11:50 .s.PGSQL.5432.lock
when I do that in a container, that runs nothing but postgres:
root@8fc7b375416b:/# ls -l /run
total 16
drwxr-x--- 2 Debian-exim Debian-exim 4096 Nov 4 2017 exim4
drwxrwxrwt 2 root root 4096 Oct 9 2017 lock
drwxr-xr-x 2 root root 4096 Oct 9 2017 mount
drwxrwsr-x 1 postgres postgres 4096 Jan 11 06:35 postgresql
-rw-rw-r-- 1 root utmp 0 Oct 9 2017 utmp
and
root@8fc7b375416b:/# ls -l /run/postgresql/
total 0
robert
On 12/01/2020 09:29, Mariel Cherkassky wrote:
> Hey,
> I have a container that runs centos image with a few changes and
> postgresql installed on it.
> Whenever I start my container or restart it, the postgresql(12) starts
> in the following state :
> postgresql dead but pid file exists
>
> For example :
>
> [root@my_container_id /]# service postgresql status
> postgresql (pid 128) is running...
> [root@ my_container_id /]# exit
> exit
> [root@docker-node]# docker restart my_container_id
> my_container_id
> [root@ docker-node ]#
> [root@ docker-node ]#
> [root@ docker-node ]# docker exec -it my_container_id /bin/bash
> [root@my_container_id /]# service postgresql status
> postgresql dead but pid file exists
>
>
> It happens since I upgraded my postgresql to version 12.
> Does anyone else suffer from the same issue ?
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: robert@redcor.ch, mariel.cherkassky@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: container restarted -> postgresql dead but pid file exists
In-Reply-To: <bee8846a-f902-c7fe-33f5-24aa187e256b@redcor.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox