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

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: PgAgent 3.3.0 batch scripts on windows always get status failed
Дата
Msg-id CA+OCxoxoCGc7d7tRdyC5-32dDMtXyT1m59s_Lk3moHTXxfMvmw@mail.gmail.com
обсуждение исходный текст
Ответ на PgAgent 3.3.0 batch scripts on windows always get status failed  (Bastiaan Olij <bastiaan@basenlily.me>)
Список pgadmin-support
[re-adding the list]

On Wed, Feb 6, 2013 at 10:41 PM, Bastiaan Olij <bastiaan@basenlily.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

Вложения

В списке pgadmin-support по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: cannot get Debugger to install on 9.2 on Win7 x-64
Следующее
От: "Vjacheslav A."
Дата:
Сообщение: Re: Possible bug report (comment on database disappered on pgAdmin 1.16.1)