Updated: cygrunsrv-0.92-2

Corinna Vinschen cygwin-apps@cygwin.com
Fri May 18 01:16:00 GMT 2001

On Thu, May 17, 2001 at 04:14:08PM -0500, Fred Yankowski wrote:
> Corinna,
> I somehow overlooked Cygrunsrv until now.  Although I've been working
> on adding functionality into the PostgreSQL program to run as an NT
> service -- much as is done in inetd and ipc-daemon -- I'm tempted to
> use Cygrunsrv instead as a wrapper.  However, the PostgreSQL case has
> several needs that are not currently handled by Cygrunsrv, AFAICT:

As I already stated in the cygwin mailing list, cygrunsrv is work
in progress. I will gratefully accept patches which fix or extend
the behaviour of cygrunsrv besides what I do by myself.

> 1.  Some way to send specific signals to the daemon process to stop it
>     in both the stop and shutdown cases.

That's a real problem in Cygwin and NT. Sending signals to
a service is a Cygwin problem (yet) since the service is
running in another thread while signal handling in Cygwin only 
works reliable for the main thread.

Even worse: NT Shutdown is somewhat touchy. We should check what
we can do here.

> 2.  Ignore SIGHUP.

Cygrunsrv tries to install a signal handler for SIGHUP and others
which for the above reason results in ignoring them :-(

> 3.  Direct stdout/stderr to a logfile.

Yup, that's on the TODO list since yesterday.

> 4.  Specify dependency on other services.

Yup, that's a simple option for the command line.

> Do these seem like reasonable features to add to cygrunsrv?

Sure they do.

> I'm quite interested, because this could drastically change my
> approach to making postgres an NT service.  I've actually got it
> working pretty well now -- thanks in good part to your recent work on
> cygwin_recv() -- but it seems a shame to have all that
> service-management code in the postgres program itself.
> I'm willing to help incorporate/patch such features into cygrunsrv, if
> that matters.

That would be really great :)

I think it's becoming more and more important to have a service
startup environment which cuddles Cygwin processes so that most
of the time nobody has to worry if a process can smoothly run as
NT service process as well.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-apps mailing list