pg_autovacuum Win32 service patch

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: pg_autovacuum Win32 service patch
Date: 2004-05-06 13:38:15
Message-ID: 03AF4E498C591348A42FC93DEA9661B889FC89@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Hi all,

The attached patch is the result of a brief session hacking
pg_autovacuum to run as a native Win32 application or service. It needs
more work before it's ready for production but I thought it best to get
some comments before going any further (which incidently, I cannot
guarantee I'll have time to do as my free time is somewhat unpredictable
right now).

Under Win32 there are now 2 new command line options:

-I - Install as a service
-R - Remove service

Both fairly self explanatory. The daemonize option is removed currently
(under Win32) due to lack of fork() on 'doze. There are a few issues:

1) Logging is now done to the event log. These are 2 problems:

- The startup messages are plentiful and soon start to fill the event
log.
- All messages are currently logged as 'Informational'. With addition of
error levels to the code this can be improved.
- Without a message library the events look terrible (I imagine the same
applies to the server). Eg.

Event Type: None
Event Source: PostgreSQL Auto Vacuum Daemon
Event Category: None
Event ID: 0
Date: 06/05/2004
Time: 14:05:39
User: N/A
Computer: PC30
Description:
The description for Event ID ( 0 ) in Source ( PostgreSQL Auto Vacuum
Daemon ) cannot be found. The local computer may not have the necessary
registry information or message DLL files to display messages from a
remote computer. You may be able to use the /AUXSOURCE= flag to retrieve
this description; see Help and Support for details. The following
information is part of the event: added table:
dave."pg_catalog"."pg_description".

2) There is no way I can find to setup startup parameters for a service
without manually writing them to the appropriate key in the registry.
This raises the question of how best to take a config when run as a
service - would a config file be appropriate, or do we just write the
options specified when the service is installed to the registry the hard
way? There is an obvious password issue to consider.

Comments/criticisms appreciated :-)

Regards, Dave

Attachment Content-Type Size
pg_autovacuum.diff application/octet-stream 20.6 KB

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Magnus Hagander 2004-05-06 14:48:40 Re: pg_autovacuum Win32 service patch
Previous Message Andrew Dunstan 2004-05-06 11:50:09 Re: Function to do runtime relative directory mapping