mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 21:21:04 +01:00
Restart worker thread only if the problem was temporary.
In case of persistent problem we don't want to loop forever. MFC after: 3 days
This commit is contained in:
parent
5abfc9c145
commit
83a5671405
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207348
@ -140,9 +140,15 @@ child_exit(void)
|
||||
proto_close(res->hr_ctrl);
|
||||
res->hr_workerpid = 0;
|
||||
if (res->hr_role == HAST_ROLE_PRIMARY) {
|
||||
sleep(1);
|
||||
pjdlog_info("Restarting worker process.");
|
||||
hastd_primary(res);
|
||||
if (WEXITSTATUS(status) == EX_TEMPFAIL) {
|
||||
sleep(1);
|
||||
pjdlog_info("Restarting worker process.");
|
||||
hastd_primary(res);
|
||||
} else {
|
||||
res->hr_role = HAST_ROLE_INIT;
|
||||
pjdlog_info("Changing resource role back to %s.",
|
||||
role2str(res->hr_role));
|
||||
}
|
||||
}
|
||||
pjdlog_prefix_set("%s", "");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user