Services generally can run normally, but sometimes there will be some of the phenomenon of suspended animation, such as the company has a time attendance service because of the hardware manufacturers rely on the API,
But the manufacturers API run for a period of time will be silent after the death, causing the entire service suspended animation, because this phenomenon of suspended animation is uncertain, so it is unlikely
See the fake after death manually to start.
Now I know there are two ways to solve this situation:
1. Write another service to listen to the current service "need some common data to determine whether it is suspended animation", one but found suspended animation, to restart
2. Restart using the service itself.
A. Open the Control Panel-"Management tools-" service, find the need to restart the service automatically, right click-"Properties, click on the Recovery tab," first failure (F) "," Second failure (S) "," subsequent failure (U) "is set to" Restart Service ", click OK,
B. The service procedure in the open-line process, the death of suspended animation, once found suspended animation, the implementation of Environment.exit (1); This will restart the service after exiting
Note: This method presupposes that the thread of suspended animation can run normally.