mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +07:00
plugins: handle corner case when PID file doesn't exist
If we get a notification and the service dies immediately, and also removes its pid file, we need to take corrective action. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -91,6 +91,11 @@ static void pidfile_update_conds(char *dir, char *name, uint32_t mask)
|
||||
pid_t pid;
|
||||
|
||||
pid = pid_file_read(pid_file(svc));
|
||||
if (pid == -1) {
|
||||
cond_clear(cond);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pid != svc->pid) {
|
||||
_d("Forking service %s changed PID from %d to %d",
|
||||
svc->cmd, svc->pid, pid);
|
||||
|
||||
Reference in New Issue
Block a user