Upstart script for pgagent on Ubuntu...

From: Brian Myers <tarkawebfoot(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Upstart script for pgagent on Ubuntu...
Date: 2011-11-29 17:30:50
Message-ID: 4D9F5721-DE13-4F1D-82D6-4B86B5C0F7C2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Has any one produced an Upstart script for pgagent on Ubuntu? I tried with the following:

<code>
description "Pgagent process control script"
author "Me"

start on started-postgres
stop on stopped-postgres

expect daemon
respawn

script
su - postgres
pgagent "dbname=postgres user=postgres"
end script
</code>

I also added an 'initctl emit started-postgres' to the pogstres-8.4 init.d and script and the corresponding stopped-postgres.

Whether I specify 'expect daemon', 'expect fork', or nothing, the command 'sudo initctl start pgagent' hangs at the command line and doesn't start the daemon. The stop command hangs also.

The 'pgagent "dbname=postgres user=postgres"' works normally if issued from the terminal prompt. I know the command is supposed to be issued from a normal user account, but shouldn't the su- command accomplish that?

Brian

Browse pgadmin-support by date

  From Date Subject
Next Message Aren Cambre 2011-12-02 03:47:43 Problems changing a view
Previous Message Cousin Florence 2011-11-25 15:47:02 RE : demande de doc