This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cygrunsrv: possible solution to a common problem


Apologies if this has been posted before, or if it's blindingly
obvious (being a *nix rather than windows person it wasn't at all
obvious to me).

A while back I posted with a query about a cygrunsrv service almost
always failing to start on boot despite being configured for automatic
startup. The service in question was rinetd, and I'd always see the
following kind of errors in the Win2k System Log,

  Event Type:	Error
  Event Source:	Service Control Manager
  Event Category:	None
  Event ID:	7009
  Date:		22/10/2001
  Time:		7:16:57 pm
  User:		N/A
  Computer:	XXX
  Description:
  Timeout (30000 milliseconds) waiting for the rinetd service to 
  connect. 

  Event Type:	Error
  Event Source:	Service Control Manager
  Event Category:	None
  Event ID:	7000
  Date:		22/10/2001
  Time:		7:16:57 pm
  User:		N/A
  Computer:	XXX
  Description:
  The rinetd service failed to start due to the following error: 
  The service did not respond to the start or control request in a   
  timely fashion.  

>From what I can make out from the archives this seems to be quite a 
common problem with a variety of daemons.

I didn't expect the latest cygrunsrv update to change anything, but in 
the process of fiddling around just on the offchance that it might I
noticed its -y/--dep option. Combined with rinetd's error logs,

  rinetd: couldn't bind to address a.b.c.d port e

which had previously made no sense to me, because there was definitely
never anything listening on the relevant port, a little lightbulb
went off ...

rinetd is a network app, so pretty clearly depends on the availablity
of networking services. I'd installed it with no dependencies, so on
startup there was a race condition: mostly it'd try to start before
the networking services and fail, but occasionally the latter would
get there first and rinetd would start successfully.

A quick comparison with a few other similar (non-cygwin) services, the  
description of the Workstation service ("Provides network connections 
and communications"), and these,

  http://support.microsoft.com/support/kb/articles/Q193/8/88.ASP
  http://httpd.apache.org/docs/win_service.html

suggested that adding --dep LanmanWorkstation would help.

And it did ... automatic startup now seems to work perfectly. My
hunch is that this will also cure startup problems with other daemons
which attempt to bind ports early on in their startup sequence.

Cheers,


Miles


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]