X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from ncopa-desktop.alpinelinux.org (unknown [79.160.13.133]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: n@tanael.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id 13FA9DC014A; Tue, 16 Dec 2014 13:47:21 +0000 (UTC) Date: Tue, 16 Dec 2014 14:47:18 +0100 From: Natanael Copa To: =?ISO-8859-1?B?UmFmYSo=?= Rzepecki Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH] testing/pgagent: new aport Message-ID: <20141216144718.6aec8aef@ncopa-desktop.alpinelinux.org> In-Reply-To: References: <1416518609-29322-1-git-send-email-divided.mind@gmail.com> <20141121083330.736d8ec5@ncopa-desktop.alpinelinux.org> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.23; x86_64-alpine-linux-musl) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, 21 Nov 2014 13:40:08 -0500 Rafa* Rzepecki wrote: > On Fri, Nov 21, 2014 at 2:33 AM, Natanael Copa wr= ote: > > > > On Thu, 20 Nov 2014 16:23:29 -0500 > > Rafa* Rzepecki wrote: > > > > > http://www.pgadmin.org/docs/dev/pgagent.html > > > a job scheduler for PostgreSQL > > > --- ... > > > diff --git a/testing/pgagent/pgagent.confd b/testing/pgagent/pgagent.= confd > > > new file mode 100644 > > > index 0000000..a85be20 > > > --- /dev/null > > > +++ b/testing/pgagent/pgagent.confd > > > @@ -0,0 +1,22 @@ > > > +# Pool time interval > > > +PGA_POLL=3D"10" > > > + > > > +# Retry period > > > +PGA_RETRY=3D"30" > > > + > > > +# Log file > > > +PGA_LOG=3D"/var/log/pgagent.log" > > > > Having the log file in /var/log means it needs to have root > > permissions. Does the agent really need to run as root? >=20 > It doesn't and shouldn't; in fact it should run as postgres in the > case the scripts are used verbatim. Frankly I just copied them from > Gentoo without much thought :) Those things probably should get > reported 'upstream' once we converge on the best solution. >=20 > Anyway, what's the preferred way to setup logging in this case? A > post-install script that creates a /var/log subdirectory with proper > permissions? >=20 > Also, I'm not entirely sure what the user should be. If the agent is > running on a local postgres, it's most practical (even if not the most > secure) if it runs as 'postgres' user so it has superuser on the > database; if it's not running on the local server, the scripts aren't > generic enough to make it work anyway (auth needs to be set up, which > might be done in a number of different ways -- password, kerberos, > ident, ssl, etc.) so an admin would have to modify the init script > anyway. I think we can run it as postgresql as default and make the alternatives configurable. >=20 > > > diff --git a/testing/pgagent/pgagent.initd b/testing/pgagent/pgagent.= initd > > > new file mode 100644 > > > index 0000000..0e37fcc > > > --- /dev/null > > > +++ b/testing/pgagent/pgagent.initd > > > @@ -0,0 +1,25 @@ > > > +#!/sbin/runscript > > > +# Copyright 1999-2012 Gentoo Foundation > > > +# Distributed under the terms of the GNU General Public License v2 > > > +# $Header: /var/cvsroot/gentoo-x86/dev-db/pgagent/files/pgagent.init= d,v 1.1 2012/04/28 18:34:11 titanofold Exp $ > > > + > > > +PGAGENTOPT=3D"-t ${PGA_POLL} -r ${PGA_RETRY} -s ${PGA_LOG} -l ${PGA_= LEVEL}" > > > + > > > +PGOPT=3D"hostaddr=3D${PG_HOST} dbname=3D${PG_DBNAME} user=3D${PG_USE= R}" > > > + > > > +depend() { > > > + use net > > > + need postgresql > > > > Does the agent really require that a postgresql server runs on this > > host even if the PG_HOST is pointing to some other host? > > > > I suspect that you can actually run the agent on different host than the > > postgresql server and in that case, you don't need postgresql. It > > should probably say "use postgresql". >=20 > Yes, thanks; as mentioned above it's just lifted from Gentoo verbatim. > I agree it should probably have use postgres, but heed the > aforementioned comments about how one would probably modify the script > anyway in anything different than the most common case. >=20 > I'm not sure how to approach it best. Ideas are welcome :) Well, you should not need edit the scripts, only the config. Thats why there is a separate conf.d/ file. I would just replace the 'need postgresql' with 'use postgresql' and remove postgresql from depends. thanks! -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---