#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
#include <signal.h>
#include <errno.h>
-
-/* POSIX.1 sys/wait.h check */
#include <sys/types.h>
-#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#endif /* HAVE_SYS_WAIT_H */
#include <sys/time.h>
#include <atalk/logger.h>
if ( child->pid != pid) {
if (child->idlen == idlen && memcmp(child->clientid, id, idlen) == 0) {
if ( child->time != boottime ) {
+ /* Client rebooted */
if (uid == child->uid) {
kill_child(child);
- LOG(log_note, logtype_default, "Disconnected child[%u], client rebooted.", child->pid);
+ LOG(log_warning, logtype_default,
+ "Terminated disconnected child[%u], client rebooted.",
+ child->pid);
} else {
- LOG(log_note, logtype_default, "Session with different pid[%u]", child->pid);
+ LOG(log_warning, logtype_default,
+ "Session with different pid[%u]", child->pid);
}
+ } else {
+ /* One client with multiple sessions */
+ LOG(log_debug, logtype_default,
+ "Found another session[%u] for client[%u]", child->pid, pid);
}
- if (child->killed)
- kill_child(child); /* this will send SIGKILL */
- LOG(log_note, logtype_default, "", child->pid, pid);
}
} else {
/* update childs own slot */
child->time = boottime;
if (child->clientid)
free(child->clientid);
- LOG(log_debug, logtype_default, "Setting client ID for %d", child->pid);
+ LOG(log_debug, logtype_default, "Setting client ID for %u", child->pid);
child->uid = uid;
child->valid = 1;
child->idlen = idlen;