简体   繁体   中英

What's the time-out value for the start-up of a Windows service

In order to debug a Windows service, written here in my company, the main function starts with:

Sleep(3000); // three seconds

This should allow me to do an "Attach to Process" while the service is starting up, but I seem to be too slow, so I decided to modify this value to 30,000 (thirty seconds).

However now, when starting up the service, I get following error message:

Prompt>net start <Service_Application>
The service is not responding to the control function.

What is the maximum value I can put there in order not to fall into such time-out?

You can get the value by accessing the registry key at HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control key ServicesPipeTimeout .

If this value is not set, its default value is set to 125 s ( see https://msdn.microsoft.com/en-us/library/windows/desktop/ms685149(v=vs.85).aspx to learn more about it ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM