public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygrunsrv to have a timeout parameter for service startup
@ 2019-02-14 21:14 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
  2019-02-15 11:09 ` Corinna Vinschen
  2019-02-15 11:50 ` Andrey Repin
  0 siblings, 2 replies; 6+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin @ 2019-02-14 21:14 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Hi all,

It looks like the cygrunsrv utility hardcodes 30 seconds as a maximal time for a service to start, then bails
out with a failure.

It would be quite useful (in certain situations) to have a command-line parameter (for the -I option)
that can specify a service startup timeout, longer or shorter than the preset default.

Thanks for considering this,
Anton Lavrentiev

P.S. Maybe for the service shutdown as well, separate or the same parameter used.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygrunsrv to have a timeout parameter for service startup
  2019-02-14 21:14 cygrunsrv to have a timeout parameter for service startup Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
@ 2019-02-15 11:09 ` Corinna Vinschen
  2019-02-15 11:50 ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2019-02-15 11:09 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

On Feb 14 20:47, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
> Hi all,
> 
> It looks like the cygrunsrv utility hardcodes 30 seconds as a maximal time for a service to start, then bails
> out with a failure.
> 
> It would be quite useful (in certain situations) to have a command-line parameter (for the -I option)
> that can specify a service startup timeout, longer or shorter than the preset default.

Patches welcome!  The source is at

https://cygwin.com/git/?p=cygwin-apps/cygrunsrv.git


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygrunsrv to have a timeout parameter for service startup
  2019-02-14 21:14 cygrunsrv to have a timeout parameter for service startup Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
  2019-02-15 11:09 ` Corinna Vinschen
@ 2019-02-15 11:50 ` Andrey Repin
  2019-02-15 12:50   ` Corinna Vinschen
  2019-02-15 15:34   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
  1 sibling, 2 replies; 6+ messages in thread
From: Andrey Repin @ 2019-02-15 11:50 UTC (permalink / raw)
  To: Lavrentiev, Anton (NIH/NLM/NCBI) [C], cygwin

Greetings, Lavrentiev, Anton (NIH/NLM/NCBI) [C]!

> It looks like the cygrunsrv utility hardcodes 30 seconds as a maximal time
> for a service to start, then bails out with a failure.

No, 30 seconds is a hard system timeout in which a service must reply with an
appropriate control message to let services.exe know it is ready to continue
startup sequence.

> It would be quite useful (in certain situations) to have a command-line
> parameter (for the -I option) that can specify a service startup timeout,
> longer or shorter than the preset default.

Is there such a feature at all to begin with?
A link to MSDN would suffice.


-- 
With best regards,
Andrey Repin
Friday, February 15, 2019 14:42:40

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygrunsrv to have a timeout parameter for service startup
  2019-02-15 11:50 ` Andrey Repin
@ 2019-02-15 12:50   ` Corinna Vinschen
  2019-02-15 14:52     ` Andrey Repin
  2019-02-15 15:34   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
  1 sibling, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2019-02-15 12:50 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

On Feb 15 14:44, Andrey Repin wrote:
> Greetings, Lavrentiev, Anton (NIH/NLM/NCBI) [C]!
> 
> > It looks like the cygrunsrv utility hardcodes 30 seconds as a maximal time
> > for a service to start, then bails out with a failure.
> 
> No, 30 seconds is a hard system timeout in which a service must reply with an
> appropriate control message to let services.exe know it is ready to continue
> startup sequence.

Oh, really?  If so, I completely forgot about that...


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cygrunsrv to have a timeout parameter for service startup
  2019-02-15 12:50   ` Corinna Vinschen
@ 2019-02-15 14:52     ` Andrey Repin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2019-02-15 14:52 UTC (permalink / raw)
  To: Corinna Vinschen, cygwin

Greetings, Corinna Vinschen!

> On Feb 15 14:44, Andrey Repin wrote:
>> Greetings, Lavrentiev, Anton (NIH/NLM/NCBI) [C]!
>> 
>> > It looks like the cygrunsrv utility hardcodes 30 seconds as a maximal time
>> > for a service to start, then bails out with a failure.
>> 
>> No, 30 seconds is a hard system timeout in which a service must reply with an
>> appropriate control message to let services.exe know it is ready to continue
>> startup sequence.

> Oh, really?  If so, I completely forgot about that...

This is the best I could dig right now at the subject.
https://www.codeproject.com/Articles/499465/Simple-Windows-Service-in-Cplusplus
And MSDN article https://docs.microsoft.com/en-us/windows/desktop/services/the-complete-service-sample
Looks much the same.

All the internet flooded with useless "pick 'service application' template in
Visual Studio" crap, hiding the actually useful information.
May be some more time spent in Google with control signal names reveal even
older (== more useful) articles.
Don't have that time right now, sorry. :(


-- 
With best regards,
Andrey Repin
Friday, February 15, 2019 16:59:39

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: cygrunsrv to have a timeout parameter for service startup
  2019-02-15 11:50 ` Andrey Repin
  2019-02-15 12:50   ` Corinna Vinschen
@ 2019-02-15 15:34   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
  1 sibling, 0 replies; 6+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin @ 2019-02-15 15:34 UTC (permalink / raw)
  To: cygwin

> No, 30 seconds is a hard system timeout in which a service must reply with
> an appropriate control message to let services.exe know it is ready to
> continue startup sequence.

I don't think there is a hard-coded system timeout, as long as the starting service keeps
posting its START_PENDING status, the service controller will wait.
And cygrunsrv seems to be doing that already.

MSDN doc says exactly that.  And I've also seen some articles that tell the same.

https://docs.microsoft.com/en-us/windows/desktop/api/winsvc/nf-winsvc-setservicestatus

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-15 14:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 21:14 cygrunsrv to have a timeout parameter for service startup Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-02-15 11:09 ` Corinna Vinschen
2019-02-15 11:50 ` Andrey Repin
2019-02-15 12:50   ` Corinna Vinschen
2019-02-15 14:52     ` Andrey Repin
2019-02-15 15:34   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).