Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDcmJ-0008RW-Tv for pgsql-general@arkaria.postgresql.org; Sat, 11 Nov 2017 20:53:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eDcmI-0008H7-Vx for pgsql-general@arkaria.postgresql.org; Sat, 11 Nov 2017 20:53:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eDcmI-0008Ga-5L for pgsql-general@postgresql.org; Sat, 11 Nov 2017 20:53:22 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eDcmE-0003V0-Tc for pgsql-general@postgresql.org; Sat, 11 Nov 2017 20:53:20 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1474:d80:76e5:bff:fef3:7e00]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 3yZ8Hx0tBlz3G7f; Sat, 11 Nov 2017 21:53:17 +0100 (CET) Date: Sat, 11 Nov 2017 21:53:16 +0100 From: Christoph Berg To: Adam Brusselback Cc: Tom Lane , "pgsql-general@postgresql.org" Subject: Re: Postgres 10.1 fails to start: server did not start in time Message-ID: <20171111205316.u56lkmkakdmcx6zm@msg.df7cb.de> Mail-Followup-To: Christoph Berg , Adam Brusselback , Tom Lane , "pgsql-general@postgresql.org" References: <8027.1510347112@sss.pgh.pa.us> <20171111132354.esi73rlpq3goyrqh@msg.df7cb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Re: Adam Brusselback 2017-11-11 > Hey Christoph, I tried starting it with init (service postgresql > start), and pg_ctlcluster. > > I modified the pg_ctl.conf and set the timeout higher so I could just > get my cluster back up and running properly, so I can't give you the > info on what systemctl status says at the moment. It looks like it's interference from systemd here. The problem is easily reproduced by putting '-t 0' into pg_ctl.conf: ● postgresql@10-main.service - PostgreSQL Cluster 10-main Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2017-11-11 21:10:56 CET; 9ms ago Process: 17946 ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast 10-main stop (code=exited, status=1/FAILURE) Process: 18000 ExecStart=postgresql@10-main --skip-systemctl-redirect 10-main start (code=exited, status=1/FAILURE) Main PID: 17878 (code=exited, status=0/SUCCESS) Nov 11 21:10:55 lehmann systemd[1]: Starting PostgreSQL Cluster 10-main... Nov 11 21:10:56 lehmann postgresql@10-main[18000]: Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -t 0 -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exited with status 1: Nov 11 21:10:56 lehmann postgresql@10-main[18000]: pg_ctl: server did not start in time Nov 11 21:10:56 lehmann systemd[1]: postgresql@10-main.service: Control process exited, code=exited status=1 Nov 11 21:10:56 lehmann systemd[1]: Failed to start PostgreSQL Cluster 10-main. Nov 11 21:10:56 lehmann systemd[1]: postgresql@10-main.service: Unit entered failed state. Nov 11 21:10:56 lehmann systemd[1]: postgresql@10-main.service: Failed with result 'exit-code'. In other words, systemd will by default stop a service that fails to start. I'm investigating if it's a good idea to tell systemd to ignore the exit code of pg_ctl(cluster). Possibly moving to Type=notify is the best solution, but not all majors support that yet. Will report back once I have a solution. Christoph -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general