Re: PGSVC : PostgreSQL Windows Service Manager - Mailing list pgsql-hackers-win32

From Magnus Hagander
Subject Re: PGSVC : PostgreSQL Windows Service Manager
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE34B6C2@algol.sollentuna.se
Whole thread Raw
In response to PGSVC : PostgreSQL Windows Service Manager  ("Keith Woodell" <efesar@unm.edu>)
List pgsql-hackers-win32
> > main distribution, it cannot rely on Borland C++ builder -
> it has to
> > compile with mingw. Since there is no other C++ code in postgresql,
> > j...
>
> Actually, there's no C++; naming it was a due to old habits.
> It should be compliant. Borland CBuilder comes with MinGW and
> gcc, which compiled it fine (although the binary on the site
> is Borland). Maybe we have different versions of MinGW? Can
> you send your output? I will fix and retry. I also have a
> separate MinGW install, to build PGSQL, and I will try that.

Haven't tried compiling it yet. But for start, there is //-comments,
which I don't think will pass a C compiler. Again, haven't specifically
tested.

Also, if we are going with an outside "service wrapper", consider
putting the install and uninstall functions into this one as parameters
"-install" etc. One less binary to worry about.

I don't have your code around right now, so I don't remember if you had
already handled the "multiple instances on the same machine" issue. If
not, that would also be a nice feature :-)


> > Also, please note that GPL code is not compatible with the current
> > postgresql license - check the archives for multiple discussions...
>
> Please tell me which license to pick. I know it will be hard
> for you to allow me to relinquish my own control, but I'm
> fine with that. Tell me which one to pick, and I'll be happy
> to switch the license. :) For me, to you all, it's free,
> whatever, beer, money, however that goes ... I don't have an
> opinion! It's all free to me!

The rest of the backend is BSD, so that would be most suitable.


> > It should be quite possible to redirect these pipes using
> the data in
> > STARTUPINFO. I'm not sure how that will handle subprocesses execu...
>
> I redirected with STARTUPINFO by many methods (including
> Microsoft's example), and it positively could not find the
> sugar to redirect. The pipes were open, I could "read" (no
> data, however), then they would close with this error: "The
> pipe has ended." I tried with and without inheritance. I can
> try to link PGSQL with a link switch called "-mwindows"
> (which apparently disables the "DOS command window"), but I
> have no idea where? On the linker, I presume, but I'm not
> that well versed. Maybe the "console" is a "superprocess" to
> the "postmaster.exe"? Just a thought ... ?
>
> As for subprocesses, I'm not that well versed. I'd prefer to
> redirect stdout/stderr, if only to save my hairline. :)

Oh yes, but to catch the data, you need to get it from both the main
postmaster and from subprocesses.

'fraid I don't know much more about this - needs further research.


//Magnus

pgsql-hackers-win32 by date:

Previous
From: "Keith Woodell"
Date:
Subject: Re: PGSVC : PostgreSQL Windows Service Manager
Next
From: "Merlin Moncure"
Date:
Subject: Re: PGSVC : PostgreSQL Windows Service Manager