Mail archive
alpine-devel

Re: [alpine-devel] [PATCH] testing/pgagent: new aport

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Fri, 21 Nov 2014 08:33:30 +0100

On Thu, 20 Nov 2014 16:23:29 -0500
Rafa* Rzepecki <divided.mind_at_gmail.com> wrote:

> http://www.pgadmin.org/docs/dev/pgagent.html
> a job scheduler for PostgreSQL
> ---
> testing/pgagent/APKBUILD | 64 +++++++++++++++++++++++++++++++++++++++++++
> testing/pgagent/pgagent.confd | 22 +++++++++++++++
> testing/pgagent/pgagent.initd | 25 +++++++++++++++++
> 3 files changed, 111 insertions(+)
> create mode 100644 testing/pgagent/APKBUILD
> create mode 100644 testing/pgagent/pgagent.confd
> create mode 100644 testing/pgagent/pgagent.initd

Thanks! I applied it, but I have a few questions below.


> diff --git a/testing/pgagent/APKBUILD b/testing/pgagent/APKBUILD
> new file mode 100644
> index 0000000..ae9eaea
> --- /dev/null
> +++ b/testing/pgagent/APKBUILD
> _at_@ -0,0 +1,64 @@
> +# Contributor: Rafal Rzepecki <rafal_at_conjur.net>
> +# Maintainer:
> +pkgname=pgagent
> +pkgver=3.4.0
> +pkgrel=0
> +pkgdesc="a job scheduler for PostgreSQL"
> +url="http://www.pgadmin.org/docs/dev/pgagent.html"
> +arch="all"
> +license="POSTGRESQL"
> +depends="wxgtk2.8-base postgresql"

What does it need from wxgtk2.8-base that is not pulled in automatic as
SO (shared object) dependency? Normally abuild will automatically add
the dependencies for dynamic libs.

I n this case, abuild will automatically add so:libwx_baseu-2.8.so.0 as
a dependency which (currently) wxgtk2.8-base provides.

I suspect that wxgtk2.8-base can be removed from depends unless I am
missing something.

Does the server really need to run on the same server as the agent? If
not, then we should not have a hard dependency for the postgresql
server.

...

> 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
> _at_@ -0,0 +1,22 @@
> +# Pool time interval
> +PGA_POLL="10"
> +
> +# Retry period
> +PGA_RETRY="30"
> +
> +# Log file
> +PGA_LOG="/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?

> 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
> _at_@ -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.initd,v 1.1 2012/04/28 18:34:11 titanofold Exp $
> +
> +PGAGENTOPT="-t ${PGA_POLL} -r ${PGA_RETRY} -s ${PGA_LOG} -l ${PGA_LEVEL}"
> +
> +PGOPT="hostaddr=${PG_HOST} dbname=${PG_DBNAME} user=${PG_USER}"
> +
> +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".

> +}
> +
> +start() {
> + ebegin "Starting pgagent"
> + start-stop-daemon --start --exec /usr/bin/pgagent -- ${PGAGENTOPT} ${PGOPT}
> + eend $?
> +}
> +
> +stop() {
> + ebegin "Stopping pgagent"
> + start-stop-daemon --stop --name pgagent
> + eend $?
> +}

-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Nov 21 2014 - 08:33:30 UTC