Re: PgAgent 3.3.0 batch scripts on windows always get status failed

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Bastiaan Olij <bastiaan(at)basenlily(dot)me>, pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: PgAgent 3.3.0 batch scripts on windows always get status failed
Date: 2013-02-07 09:08:06
Message-ID: CA+OCxoxoCGc7d7tRdyC5-32dDMtXyT1m59s_Lk3moHTXxfMvmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

[re-adding the list]

On Wed, Feb 6, 2013 at 10:41 PM, Bastiaan Olij <bastiaan(at)basenlily(dot)me> wrote:
> Hey Dave,
>
> As you've read from David's reply the job's status now comes back as
> successful which solves our immediate issue. I did a little more testing
> to see if I could get it to react to different exit codes and that seems
> to still be ignored so the GetExitCodeProcess command doesn't seem to do
> it's thing (or I'm doing something wrong).

It worked for me :-)

> I simply added an EXIT /B 2 at the end of the script to see if it would
> pick up the error code 2 but the error code returned remained 0.

Remove the /B and it should work. GetExitCodeProcess is returning the
cmd.exe return value, not the scripts ERRORLEVEL.

> Mind you, reading the documentation on GetExitCodeProcess it doesn't
> return an error code if the process hasn't finished running yet and it
> also mentions it's only supported on desktop applications and may thus
> not be available to a service.

I just tested it as a service and it worked fine :-). Proof attached!
(ids 32 and above are run as a service, with pgAgent running under the
LocalSystem account). Ignore some of the earlier ones - they were me
debugging.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
image/png 38.6 KB

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Vjacheslav A. 2013-02-07 09:34:44 Re: Possible bug report (comment on database disappered on pgAdmin 1.16.1)
Previous Message Dave Page 2013-02-07 08:53:50 Re: cannot get Debugger to install on 9.2 on Win7 x-64