Re: Postmaster service code
От | Dave Page |
---|---|
Тема | Re: Postmaster service code |
Дата | |
Msg-id | 03AF4E498C591348A42FC93DEA9661B889FCCF@mail.vale-housing.co.uk обсуждение исходный текст |
Ответ на | Postmaster service code ("Dave Page" <dpage@vale-housing.co.uk>) |
Список | pgsql-hackers-win32 |
> -----Original Message----- > From: Magnus Hagander [mailto:mha@sollentuna.net] > Sent: 09 May 2004 18:41 > To: Laurent Ballester; Darko Prenosil; Dave Page; > pgsql-hackers-win32@postgresql.org > Subject: RE: [pgsql-hackers-win32] Postmaster service code > > I would suggest implementing the DllRegisterServer() and > DllUnRegisterServer() entrypoint in a small C file that is > compiled into the DLL. That way, a user can just run > "regsvr32 pgevent.dll" (or whatever it's called). > See > http://msdn.microsoft.com/library/default.asp?url=/library/en- > us/com/htm > /cmf_d2l_3cmq.asp I wonder if this should also be added to the service install code so at least it is done automatically when that is run. I used the following in the autovacuum daemon: /* * Set the Event source for the application log */ sprintf(szKey, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\PostgreSQL Auto Vacuum"); if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hk, NULL)) return -5; sprintf(szMsgDLL, "pgmessages.dll"); if (RegSetValueEx(hk, "EventMessageFile", 0, REG_EXPAND_SZ, (LPBYTE)szMsgDLL, (DWORD)strlen(szMsgDLL)+1)) return -6; And to remove it again /* * Remove the Event source from the application log */ sprintf(szKey, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application"); if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_ALL_ACCESS, &hk)) return -4; if (RegDeleteKey(hk, "PostgreSQL Auto Vacuum")) return -5; > >Do you know, where will be the right place to put these files and > >update/create a Makefile > > I would suggest creating "bin/pgevent". Comments? Sounds OK to me. Regards, Dave.
В списке pgsql-hackers-win32 по дате отправления: