new option --exit-on-no-clients

This commit is contained in:
Maxim Devaev
2022-02-14 02:44:58 +03:00
parent 3a8f035014
commit 616a3eb6a6
7 changed files with 64 additions and 11 deletions

View File

@@ -137,3 +137,11 @@ INLINE void process_notify_parent(void) {
LOG_PERROR("Can't send SIGUSR2 to the parent process %d", parent);
}
}
INLINE void process_suicide(void) {
pid_t pid = getpid();
if (kill(pid, SIGTERM) < 0) {
LOG_PERROR("Can't send SIGTERM to own pid %d", pid);
}
}