#define DEFAULTPORT "4700"
struct server {
- struct volinfo *volinfo;
+ char *v_path;
pid_t pid;
time_t tm; /* When respawned last */
- int count; /* Times respawned in the last TESTTIME secondes */
+ unsigned int count; /* Times respawned in the last TESTTIME secondes */
int control_fd; /* file descriptor to child cnid_dbd process */
};
if (WIFEXITED(status)) {
LOG(log_info, logtype_cnid, "cnid_dbd[%i] exited with exit code %i",
pid, WEXITSTATUS(status));
+ } else {
+ /* cnid_dbd did a clean exit probably on idle timeout, reset bookkeeping */
+ srv[i].tm = 0;
+ srv[i].count = 0;
}
- if (WIFSIGNALED(status)) {
- LOG(log_info, logtype_cnid, "cnid_dbd[%i] received signal %i",
+ else if (WIFSIGNALED(status)) {
+ LOG(log_info, logtype_cnid, "cnid_dbd[%i] got signal %i",
pid, WTERMSIG(status));
}
sigchild = 0;