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 1iqvzo-0002vP-0j for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jan 2020 09:26:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iqvzm-00077D-NS for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jan 2020 09:26:50 +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 1iqbcI-0007RK-JC for pgsql-admin@lists.postgresql.org; Sun, 12 Jan 2020 11:41:14 +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 1iqbcC-000853-VR for pgsql-admin@lists.postgresql.org; Sun, 12 Jan 2020 11:41:14 +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@redo2oo.ch) by susanne.redcor.ch (Postfix) with ESMTPSA id D059EA0214; Sun, 12 Jan 2020 12:41:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=redo2oo.ch; s=201908; t=1578829265; bh=A1/B8Zf/gUdK84nXI+FwCY9+DZguQLiD3gddfrciDq4=; h=Subject:To:References:From:Date:In-Reply-To:From; b=kV4ofd/UUep8/FSG1yDPiL8fVyWpay2pNo4JWB0QMgVwQmfP10V1mMRcVjCl3Kv0A Kebom0NlxnNQRlqN8zR4jiYaPP63V73Dn7fXSFFGu+4gVfeLHLZnOm5abKf5c5tN1P RsH+Vn+BFXykpY3WXR/Ai+6gRiS2au76A1+xlV94FnHlLaILa28DbTys+ZWud8OsVE 1RKXDglSXetf9KXveKkg/rva/yHDjLN+UQ5ccT1pobj1dTC/ra7x1v/GIYV/wtBnSb aZVJWeGXXTRAedl/00tDIfPU9YYLR+4OG53XoliwY//h0CyGcn0wh2vg+DFp1BVPmF GdgSgfdI4fjMw== Subject: Re: container restarted -> postgresql dead but pid file exists To: Mariel Cherkassky , pgsql-admin@lists.postgresql.org References: From: robert Message-ID: Date: Sun, 12 Jan 2020 12:41:05 +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 ? > >