mirror of
https://github.com/troglobit/finit.git
synced 2026-10-22 11:36:07 +00:00
service: kill stubborn services, wait before restart
Add support for registering callbacks to be called after a given timeout. Use this to implement forceful termination of services that refuse to terminate upon receiving a SIGTERM. If the service PID is not collected within 3 seconds, send a SIGKILL to it. Also, rework restarting of crashing services. When a service crashes for the first time, try to restart it immediately. If it crashes again, wait a few seconds before trying again. Just as before, if it continues to crash, block the service.
This commit is contained in:
1 parent
b4f385d2e0
commit
10b72f1d7f
5 files changed
+146
-12
No files matched your search
@@ -34,6 +34,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <lite/lite.h>
|
||||
#include <uev/uev.h>
|
||||
|
||||
#define CMD_SIZE 256
|
||||
#define LINE_SIZE 1024
|
||||
@@ -90,6 +91,8 @@ extern char *hostname;
|
||||
extern char *username;
|
||||
extern char *runparts;
|
||||
extern char *console;
|
||||
extern uev_ctx_t *ctx;
|
||||
|
||||
extern char *__progname;
|
||||
|
||||
#endif /* FINIT_H_ */
|
||||
|
||||
Reference in new issue
Block a user