Re: [HACKERS] [PATCHES] fork/exec patch - Mailing list pgsql-hackers-win32

From Steve Tibbett
Subject Re: [HACKERS] [PATCHES] fork/exec patch
Date
Msg-id 546CD3100F4C0F42A30A94C0F2B349148FC639@zimmail1.zim.zimismobile.com
Whole thread Raw
List pgsql-hackers-win32
>>Right. I expect we'll need 3 extra command line switches: one to
>>install as a service, one to remove the service, and one to run as a
>>service. Or possibly a small wrapper for the install/remove part, plus

>>one extra command switch.

>Normally, that would be handled by the installation program. But
>there'd definitly be a need for a manual way to do it as well,
>yes. (There are tools in the resource kit, but people shouldn't need
that)

The convention is:

  # install the service
  mysvc.exe -i

  # uninstall the service
  mysvc.exe -u

When your service is "installed", simply invoking it should cause it to
register itself with the service control manager, which can then send it
commands.  This will make it work when the user does:

  net start postmaster
  net stop postmaster

This uses the same mechanism that gets used when you go to the Services
control panel and ask a service to stop.

>We'd probably need a tool like "pgsignal" or something that
>would send signals to the backends. Since you can't use the
>kill commandline tool (that one only supports what would be
>called kill -9 on unix)

When the user says "net stop postmaster", an entry point in
postmaster will be called by the Service Control Manager. Then
postmaster will have to send the signals to the other processes
asking them to stop and presumably wait for them to stop before
terminating itself.

--
Steve Tibbett
stibbett@zim.biz


pgsql-hackers-win32 by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: [HACKERS] [PATCHES] fork/exec patch
Next
From: "Magnus Hagander"
Date:
Subject: Re: [HACKERS] [PATCHES] fork/exec patch