Home > Net >  Certain functions directly into a Windows service, but the service is always crash, how to make the
Certain functions directly into a Windows service, but the service is always crash, how to make the

Time:11-12

Certain functions directly into a Windows service, but the service is always crash, how to make the service automatically restart after the collapse

CodePudding user response:

Must be abnormal collapsed, abnormal add a process to start the service,

CodePudding user response:

You can try to catch the exception, and then see what is the cause, service and old collapse probability is so high, should be solved

CodePudding user response:

reference 1/f, mouse cried dead cat replies:
is definitely abnormal collapsed, abnormal add a process to start the service,

The great god, abnormal add a process to start the service of this how to operate?

CodePudding user response:

First of all, is the collapse of handle exceptions, break up is you of wrong,
Second, the services are set inside restore Settings, can undertake when service failure to restart services or other operations,
And, of course, the most HanHanDe method, you can write a look at this service hang up, ha ha ha ha,

CodePudding user response:

play a pot of soy sauce reference 3 floor response:
Quote: refer to 1st floor mouse cried dead cat replies:
is definitely abnormal collapsed, abnormal add a process to start the service,

The great god, abnormal add a process to start the service of this how to operate?

What I mean is that crashes it is possible that your code has a problem, try catch exceptions capture once a hint, if you don't want to find a reason, to write a Process in the abnormal start the program, as if, after the collapse of the Process is not carried out, on the front and prompt program in running, add a service, post a note directly to catch this service, make the service to restart,

You can't find what causes collapse,

CodePudding user response:

First of all, to fundamentally solve the problem to find the cause of the "collapse"..

At least not to let him "total" collapse.

Second, guard general process is a good solution..

Principle is to write in a service, regularly listen you this service process.. Once found stopped and then automatically start..

CodePudding user response:

Take temporary solution not effect a permanent cure, you this exception is not captured by yourself that caused the service to stop, you can go to the event viewer to see if there is any error, or your own service record run log, the error log, followed to which he is wrong, then for modifications

CodePudding user response:

Must get the value, plus the try catch, such as access to the database and other interface and other hardware and docking

CodePudding user response:

First of all, to fundamentally solve the problem to find the cause of the "collapse"..

At least not to let him "total" collapse.

Second, guard general process is a good solution..

Principle is to write in a service, regularly listen you this service process.. Once found stopped and then automatically start..

CodePudding user response:

Does have some service exceptions to collapse, such as the original CS1.5 server, this is a great god company wrote
I will add a thread, to make an exe to monitor the service and there? Not, is to reset the service
-
Above is one of my ideas, you can reference,

CodePudding user response:

This problem is a little mean www.ppthui.com

CodePudding user response:

If restart will solve the problem, add a daemon must be good, and can be scheduled time to restart,

CodePudding user response:

Must not make what daemons, restart the service, to find errors, get rid of the bug, this is the fundamental way to solve, just like the try catch, not to ignore the error and also don't superstitious what a great god, and god will make mistakes, like go to version 1.13 of the HTTP module is a bug, you can believe that Google's great spirit will make low-level mistakes? Everything will be subject to the facts,

CodePudding user response:

Don't consider to restart the service, be sure it is service process code problem, restart the service also in vain, to seek the reason of the code,

CodePudding user response:

Modify the bug with guard services, are very important for mature products, which is a revolutionary measures as to reject cannot learn Q, our service running four to five years of big companies, also do not need to maintain, but we still have to use a less than 20 lines of Windows service to guard and took it,

CodePudding user response:

reference 15 floor interacting in a professional developer response:
modify the bug with guard services, are very important for mature products, which is a revolutionary measures as to reject cannot learn Q, our service running four to five years of big companies, also do not need to maintain, but we still have to use a less than 20 lines of Windows service to guard and took it,


Elder brother, some words don't need to say very correct, you say so, he has a 90% chance, just to get a guardian of the service, as for bugs, thrown to the outside of the cloud nine, anyway just broken restart, some business is not easy to reset the users really feel, seen too many such people, not to force the,

CodePudding user response:

Suggest make a winfrom window procedure, hide the taskbar, system service has a problem, including authority, winfrom as long as you do not turn off, and then put in startup, restart the computer will automatically run,

CodePudding user response:

A Windows service, you can set to automatically shut down after the restart, do not need to code, can configure

CodePudding user response:

restart or still will collapse,
It is better to code capture abnormal debugging for the cause of the crash
  •  Tags:  
  • C#
  • Related