Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XvT6N-0002eu-F5 for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Dec 2014 15:41:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XvT6M-0003Bz-Vp for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Dec 2014 15:41:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XvT6M-0003Br-Ct for pgsql-bugs@postgresql.org; Mon, 01 Dec 2014 15:41:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XvT6I-00077m-KI for pgsql-bugs@postgresql.org; Mon, 01 Dec 2014 15:41:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sB1FfFvW011032; Mon, 1 Dec 2014 10:41:15 -0500 From: Tom Lane To: =?UTF-8?B?SGVucmlrIFN0w7hybmVy?= cc: Sandeep Thakkar , henrik-postgres@hswn.dk, "pgsql-bugs@postgresql.org" Subject: Re: BUG #12072: init script creates pid file with wrong owner In-reply-to: <547C1467.2020307@hswn.dk> References: <20141126141924.15506.75024@wrigleys.postgresql.org> <547C1467.2020307@hswn.dk> Comments: In-reply-to =?UTF-8?B?SGVucmlrIFN0w7hybmVy?= message dated "Mon, 01 Dec 2014 08:10:31 +0100" Date: Mon, 01 Dec 2014 10:41:15 -0500 Message-ID: <11031.1417448475@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org =?UTF-8?B?SGVucmlrIFN0w7hybmVy?= writes: > The problem is with the init script installed from the rpm package. From > line 161 it performs the server start by doing > echo -n "$PSQL_START" > $SU -l postgres -c "$PGENGINE/postmaster -p '$PGPORT' -D > '$PGDATA' ${PGOPTS} &" >> "$PGLOG" 2>&1 < /dev/null > sleep 2 > pid=`head -n 1 "$PGDATA/postmaster.pid" 2>/dev/null` > if [ "x$pid" != x ] > then > success "$PSQL_START" > touch "$lockfile" > * echo $pid > "$pidfile"* > echo > else > failure "$PSQL_START" > echo > script_result=1 > fi > Note the > echo $pid > "$pidfile" > This creates a pid-file owned by root. Why is the init script creating such a file at all? Surely it should be depending on the one created by the postmaster. However, if there is a reason to create a separate pidfile, I don't see the problem particularly: the postmaster will neither create nor remove it, so it hardly matters what the ownership is. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs