Setting up Windows service dependencies

Source: Internet
Author: User

Scene Restore: A project developed by python2.7, made into a Windows service, starts with the system. After the system restart, the discovery service failed to start automatically, check that the Event Viewer log Discovery service started before the MySQL database service, and the service failed to start because MySQL must be accessed in the service. Although an attempt to restart after a startup failure has been set, the project service cannot be started from startup.

Problem Detail: 1.XP system Cannot set service "auto (delay)" mode

2. The service starts before the MySQL service. Sleep is set in the code, but the service mechanism for Windows is that the system will ask the service to return the service status (whether it is already running) for a period of time since the service started (not verified, but must have been). If the program sleep is unresponsive at this time, the system will assume that the service failed to start. In fact, the program will start after the sleep, the service status has been identified as not started, so the system only provides a startup button, the service becomes the system can not control the process, can not open or shut down, only by killing process to stop the program.

Solution:

1. Open the Registry (Win+r regedit) and open the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services path.

2. Find the services you need to set dependencies, add/modify multi-string values: DependOnService. The value is a service or program that starts before the service.

Note:

SC CONIFG Service name depend= "dependencies", this cmd command seems not very reliable, may be written incorrectly.

Setting up Windows service dependencies

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.