From: Tom Lane <tgl@sss.pgh.pa.us>
To: Henrik Størner <henrik@hswn.dk>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Cc: henrik-postgres@hswn.dk
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12072: init script creates pid file with wrong owner
Date: Mon, 01 Dec 2014 10:41:15 -0500
Message-ID: <11031.1417448475@sss.pgh.pa.us> (raw)
In-Reply-To: <547C1467.2020307@hswn.dk>
References: <20141126141924.15506.75024@wrigleys.postgresql.org>
<CANFyU97+vW3x1c0b=cOy5CwcPAKw-oOqJ7p2hfwv2nNrn=3JoA@mail.gmail.com>
<547C1467.2020307@hswn.dk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
=?UTF-8?B?SGVucmlrIFN0w7hybmVy?= <henrik@hswn.dk> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, henrik@hswn.dk, sandeep.thakkar@enterprisedb.com, henrik-postgres@hswn.dk
Subject: Re: BUG #12072: init script creates pid file with wrong owner
In-Reply-To: <11031.1417448475@sss.pgh.pa.us>
References: <20141126141924.15506.75024@wrigleys.postgresql.org> <CANFyU97+vW3x1c0b=cOy5CwcPAKw-oOqJ7p2hfwv2nNrn=3JoA@mail.gmail.com> <547C1467.2020307@hswn.dk> <11031.1417448475@sss.pgh.pa.us>
* 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