Re: pgagent status always successful

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: <erics(at)ameri-title(dot)com>,<pgadmin-support(at)postgresql(dot)org>
Subject: Re: pgagent status always successful
Date: 2006-06-30 07:57:13
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E401388C9C@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgadmin-support

> -----Original Message-----
> From: pgadmin-support-owner(at)postgresql(dot)org
> [mailto:pgadmin-support-owner(at)postgresql(dot)org] On Behalf Of Eric Shuman
> Sent: 29 June 2006 20:06
> To: pgadmin-support(at)postgresql(dot)org
> Subject: [pgadmin-support] pgagent status always successful
>
> I am new to pgadmin and pgagent and need some help.
>
> I am trying to set up a job in pgadmin3 that runs
> automatically through
> pgagent. I want the job to stop if any of the steps fail.
> Some of the steps
> are bash scripts. I have set the "On Error" flag to fail.
>
> I can get my bash scripts to run through pgagent, but the
> status of the
> script always comes back as "Successful" with a result of "1" (in the
> statistics section for the step in pgadmin), this happens
> even if I use an
> invalid filename for the script. I have also tried exiting
> the scripts with
> various exit codes and have used "set -e" with out effect.
>
> Is this a bug or am I missing something obvious? Can anyone
> give me some
> advice on setting up jobs?

Yes, it's a bug. Please give the attached patch to xtra/pgagent/job.cpp
a whirl and see if it helps. You should get a result of -1 if there is
an error executing the script, otherwise whatever the return value of
the script is.

Note that on Windows there is currently no way to get the script return
value.

Please let me know if it works as expected.

Regards, Dave

Attachment Content-Type Size
pgagent-retcode.diff application/octet-stream 729 bytes

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2006-06-30 08:05:21 Re: pgagent status always successful
Previous Message Peter Newman 2006-06-30 07:32:39 100% CPU