First : Appologize for my bad english.
Sorry for this newbie software question, but I got lost with my own logic…
A bit background :
I am working on a C networking project, where I am trying to generate a server that receive gradually increasing UDP message within the increasing time. I am trying just to simple “manager” on this server that is able to send a report to a specific address when it is crashing.
The thing that come in mind is that I set this manager as a listener in the server side. So if the server does not receive any message within the predefined port, I assume the server fails.
But, this thing is not -somehow- a deterministic approach. How long should I specify the time if this server crash? (if in 5 minutes no message is received in the port, does it mean it is crashing? not necessarly true. I can again increase it to 10 mins, buat again, this is unjustiable and inconsistent)
I am thinking how an app like gdb can do this. If the server(framework) crash, it will automatically generate a coredump file. I need to do a similar thing like this, so when the framework crash, it will as easy as print a “hello crash”. How to create a “manager” on the server that can give me a report if the server crash (using C )
Any idea would be greatly appreciated
Thank you so much
The exit code of a process tells you if a signal caused it to exit. You can write a C program and use
wait()to get the exit code or do it in a shell script:You could choose to restart the server for the failure case or the signal case.
Most servers rely on careful debugging and do not expect to automatically catch and restart when they crash.