Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPfrE-0003O8-T5 for pgsql-pkg-yum@arkaria.postgresql.org; Wed, 12 Aug 2015 23:54:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZPfrE-0000Bg-EJ for pgsql-pkg-yum@arkaria.postgresql.org; Wed, 12 Aug 2015 23:54:56 +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) (envelope-from ) id 1ZPfrD-0000BT-0E for pgsql-pkg-yum@postgresql.org; Wed, 12 Aug 2015 23:54:55 +0000 Received: from smtp80.ord1c.emailsrvr.com ([108.166.43.80]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZPfr4-0006eD-OT for pgsql-pkg-yum@postgresql.org; Wed, 12 Aug 2015 23:54:53 +0000 Received: from smtp27.relay.ord1c.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp27.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 50066380162; Wed, 12 Aug 2015 19:54:45 -0400 (EDT) Received: by smtp27.relay.ord1c.emailsrvr.com (Authenticated sender: jeff.frost-AT-pgexperts.com) with ESMTPSA id 99F6138009D; Wed, 12 Aug 2015 19:54:43 -0400 (EDT) X-Sender-Id: jeff.frost@pgexperts.com Received: from [10.10.10.9] (8.202-62-69.ftth.swbr.surewest.net [69.62.202.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:587 (trex/5.4.2); Wed, 12 Aug 2015 23:54:45 GMT Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: systemd service files vs. postgresql9x-setup From: Jeff Frost In-Reply-To: <0EDD19E44F05669CE0D68F45@eje.credativ.lan> Date: Wed, 12 Aug 2015 16:54:41 -0700 Cc: pgsql-pkg-yum@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <0AC9AAC9-0B01-47E3-860F-620C5F0912F1@pgexperts.com> References: <0EDD19E44F05669CE0D68F45@eje.credativ.lan> To: Bernd Helmle X-Mailer: Apple Mail (2.2102) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-pkg-yum Precedence: bulk Sender: pgsql-pkg-yum-owner@postgresql.org >=20 > On Aug 12, 2015, at 7:18 AM, Bernd Helmle wrote: >=20 > Hi, >=20 > Looks like postgresql9[45]-setup is careless when someone tries to use th= em > in customized > systemd environments (e.g. via drop-in configurations[1]). Currently we do > this: >=20 > # this parsing technique fails for PGDATA pathnames containing spaces, > # but there's not much I can do about it given systemctl's output format.= .. > PGDATA=3D`systemctl show -p Environment "${SERVICE_NAME}.service" | > sed 's/^Environment=3D//' | tr ' ' '\n' | > sed -n 's/^PGDATA=3D//p' | tail -n 1` >=20 > [...some more code later...] >=20 > # Get data directory from the service file > PGDATA=3D`sed -n 's/Environment=3DPGDATA=3D//p' "${SERVICE_FILE}"` >=20 > So we obviously overwrite any PGDATA setting returned by 'systemctl show' > earlier. If someone uses service files only, this doesn't heavily matter, > since SERVICE_FILE is tested against multiple locations. However, drop-in > configurations are ignored/overwritten with this method. I don't > understand, why we do the sed approach anyways, since 'systemctl show' > already covers all cases, afaics. So i suggest to get rid of handling the > SERVICE_FILE directly and leave 'systemctl show' alone, patch attached. >=20 > Opinions? >=20 > [1] Unfortunately, I=E2=80=99m not that familiar with systemd yet and Devrim is= out for a few weeks, so we might not get to this very quickly. --=20 Sent via pgsql-pkg-yum mailing list (pgsql-pkg-yum@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-pkg-yum