Thread: pg_ctl service integration for WIN32

pg_ctl service integration for WIN32

From
Claudio Natoli
Date:
Here's a rough first cut, close to application state but not a finished
work.

Might be pushed for time over the next week, so if there are major
criticisms it might need someone else to pick this up in the short term.
I'll happily redo any minor bits.

Comments?

Cheers,
Claudio


---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>



Attachment

Re: pg_ctl service integration for WIN32

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-patches-owner@postgresql.org
> [mailto:pgsql-patches-owner@postgresql.org] On Behalf Of
> Claudio Natoli
> Sent: 16 June 2004 14:49
> To: pgsql-patches@postgresql.org
> Subject: [PATCHES] pg_ctl service integration for WIN32
>
>
> Here's a rough first cut, close to application state but not
> a finished work.
>
> Might be pushed for time over the next week, so if there are
> major criticisms it might need someone else to pick this up
> in the short term.
> I'll happily redo any minor bits.
>
> Comments?

Looks OK to me at a quick glance. One thought though, whilst I like the
idea of using service pause to do a SIGHUP from a convenience point of
view, it's not exactly the expected behaviour and might leave the
inexperienced user wondering why the server is still running normally.
I'm on the fence regarding which way to to go with that though...

Regards, Dave

Re: pg_ctl service integration for WIN32

From
Bruce Momjian
Date:
Wow, my START /B code stays in pg_ctl?  Interesting.  I thought that was
going to be ripped out.

---------------------------------------------------------------------------

Claudio Natoli wrote:
>
> Here's a rough first cut, close to application state but not a finished
> work.
>
> Might be pushed for time over the next week, so if there are major
> criticisms it might need someone else to pick this up in the short term.
> I'll happily redo any minor bits.
>
> Comments?
>
> Cheers,
> Claudio
>
>
> ---
> Certain disclaimers and policies apply to all email sent from Memetrics.
> For the full text of these disclaimers and policies see
> <a
> href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
> ailpolicy.html</a>
>
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_ctl service integration for WIN32

From
Claudio Natoli
Date:
Bruce Momjian writes:
> Wow, my START /B code stays in pg_ctl?  Interesting.  I
> thought that was going to be ripped out.

Didn't touch on anything other than service integration.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: pg_ctl service integration for WIN32

From
Claudio Natoli
Date:
Dave Page writes:
> Looks OK to me at a quick glance. One thought though, whilst I like the
> idea of using service pause to do a SIGHUP from a convenience point of
> view, it's not exactly the expected behaviour and might leave the
> inexperienced user wondering why the server is still running normally.
> I'm on the fence regarding which way to to go with that though...

Likewise, I have no strong feelings either way. Apparently it is an accepted
paradigm.

Subconsciously, I must be against it, as I failed to pass a flag to enable
the Pause/SIGHUP operation. :-)

Amended patch attached.
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>



Attachment

Re: pg_ctl service integration for WIN32

From
"Dave Page"
Date:

> -----Original Message-----
> From: Claudio Natoli [mailto:claudio.natoli@memetrics.com]
> Sent: 17 June 2004 02:00
> To: Dave Page; Claudio Natoli; pgsql-patches@postgresql.org
> Subject: RE: [PATCHES] pg_ctl service integration for WIN32
>
>
> Dave Page writes:
> > Looks OK to me at a quick glance. One thought though, whilst I like
> > the idea of using service pause to do a SIGHUP from a convenience
> > point of view, it's not exactly the expected behaviour and
> might leave
> > the inexperienced user wondering why the server is still
> running normally.
> > I'm on the fence regarding which way to to go with that though...
>
> Likewise, I have no strong feelings either way. Apparently it
> is an accepted paradigm.

Fair enough - in which case let's keep it and document it someplace.
It'll definitely be handy for those that know about it.

> Subconsciously, I must be against it, as I failed to pass a
> flag to enable the Pause/SIGHUP operation. :-)

:-)

Regards, Dave.

Re: pg_ctl service integration for WIN32

From
"Magnus Hagander"
Date:
>
>Amended patch attached.
>Claudio


Hi!

Been testing this, and found a couple of small issues. Attached is a
patch that fixes these. (Note - Claudios patch is included in this one,
since it hasn't been applied yet..)

The issues:
1) When something goes bad, output went to stderr. No way to see that on
win32. Changed to put it to the eventlog when stderr is not a tty. This
also replaces the fprintf(stderr with write_stderr(, the same way my
backend patch does (updated version coming up soon).

2) Append ".exe" to the filename if that is not done automatically. It
wasn't done for me, but since other have had it running, it must work
sometimes... Without this, the service won't stard with an error stating
that there is no valid win32 executable availeble.

3) Prepend ".\" to the account name used to register the service, if no
domain is specified. Required for local domains, and makes it easier for
those not used to having to type .\ for local accounts..


Apart from those, looks good to me.

//Magnus



Attachment

Re: pg_ctl service integration for WIN32

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
>> Amended patch attached.
>> Claudio

> Been testing this, and found a couple of small issues. Attached is a
> patch that fixes these. (Note - Claudios patch is included in this one,
> since it hasn't been applied yet..)

Applied, but where's the documentation update?

            regards, tom lane