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

From Keith Woodell
Subject PGSVC : PostgreSQL Windows Service Manager
Date
Msg-id DAEPLOBLGHIGDDNJMMOKIEDKCGAA.efesar@unm.edu
Whole thread Raw
In response to Success report  (Cyrille Chepelov <cyrille@chepelov.org>)
List pgsql-hackers-win32
Hi all,

I'm new, so please let me introduce myself. I'm Keith, a history and
classical studies student at University of New Mexico. I'm formerly a
professional programmer, turned amateur/hobbyist coder. I have about 15
years of programming experience. My current languages are PHP4/PHP5, C/C++,
Java. I've been programming (both schema and structured) databases for about
5 years. I'm well versed in MSSQL 2000, PostgreSQL 7.1+, SQLite and MySQL 3+
... I worked for a period of time on PGAdmin III (although my code was
eventually left out because I never completed it).

Now that is done with...

I found the Win32 Native status page and compiled PostgreSQL. Then I ported
a few databases, which seem to work fine except for minor quirks. This got
me so very happy!!

The only problem was that I couldn't get it to run automatically on boot,
etc.

So ... I wrote a small service manager. It starts, stops and recovers
postmaster -- even on shutdown and startup. I've tested in on WinXP. It also
installs and uninstalls the service. I realize that this was on the "TODO"
list, so I hope I didn't step on anyone's toes. Honestly, I was just going
to horde this little app for myself, but ... in the name of open source!

Since I know there are procedures and coding styles to be part of the PGSQL
project, I made this little weekend code session its own project. I've
called it PGSVC. I hope someone will see fit to integrate this code into the
PGSQL project. Or help me figure out how to do it.

The current project page is http://www.efesar.com/pgsvc  ... This might be
wonky for a few days because I'm transitioning my server to a different DNS.
Hopefully my SourceForge page will be up in a few days, but for now the
binary and sources are available on the above mentioned URL.

Major missing component: I cannot redirect standard output/error on the
postmaster "child process" in Windows ... I spent way too many hours with no
results, and many different techniques. When I fix this, PGSVC will be
feature complete. If there's no way to redirect stdout/stderr, then I'd like
to suggest that Win32 code be added to the PGSQL CVS. The code should send
stdout/stderr to a named pipe (just the way signals are rewritten for
Win32). I would not recommend using the Windows Event Log, because I've seen
PGSQL logs get to be several megs large when using a high debug level. That
would be a real hassle to to use the crappy WinEventLog interface ... imho.

Todo: make a tray monitor applet, a la ApacheMonitor.

Also, I apologize for the long email.

-Keith Woodell
System Administrator
Natural Heritage New Mexico
505-277-3822 ext 232, 505-277-3844 (fax)

Please report NHNM technical support issues at http://admin.heritage.unm.edu


pgsql-hackers-win32 by date:

Previous
From: Cyrille Chepelov
Date:
Subject: Success report
Next
From: "Magnus Hagander"
Date:
Subject: Re: PGSVC : PostgreSQL Windows Service Manager