Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iqbcr-0000VE-A7 for pgsql-admin@arkaria.postgresql.org; Sun, 12 Jan 2020 11:41:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iqbcp-0007dg-SV for pgsql-admin@arkaria.postgresql.org; Sun, 12 Jan 2020 11:41:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iqbcp-0007dY-He for pgsql-admin@lists.postgresql.org; Sun, 12 Jan 2020 11:41:47 +0000 Received: from susanne.redcor.ch ([178.63.103.72]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iqbco-00085H-6h for pgsql-admin@lists.postgresql.org; Sun, 12 Jan 2020 11:41:47 +0000 Received: from [192.168.0.221] (84-72-41-4.dclient.hispeed.ch [84.72.41.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robert@redcor.ch) by susanne.redcor.ch (Postfix) with ESMTPSA id DB249A0214; Sun, 12 Jan 2020 12:41:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=redcor.ch; s=201908; t=1578829305; bh=A1/B8Zf/gUdK84nXI+FwCY9+DZguQLiD3gddfrciDq4=; h=From:Subject:To:References:Date:In-Reply-To:From; b=JBGn3nX/DyPTuApOU6LfqazfK3wYsm5H40sKMVek7iXLMKwTmL1uPcbBbH14HwL9h qVwAPaxX8tXNtnvosJWnaU2QtG0/ukphKVTPzHjk4Q2vW2pEDKDEwaORNw7m9V79Ms sglOidJXb/WqNx5pN8OaA8jkp8gf2/KEH2FzvGr2y7qnPoNZuKW8iVBu1LQKtpIfwY knWJXRKBNVZ3hs2wec3WSfccJ36lVw3hHOd81HMFjwhapSJtOBDHBoHJfMTO4LMEBI YD8Zpyt7vshR5dY4zVA3aHKizHvkC3g1fIy/wrHlaghhaEl5d0pCjo+QxRujI+eS9A tdZAk3zdakqBw== From: robert Subject: Re: container restarted -> postgresql dead but pid file exists To: Mariel Cherkassky , pgsql-admin@lists.postgresql.org References: Message-ID: Date: Sun, 12 Jan 2020 12:41:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 ? > >