[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
need to give old daemons time to die
Some of our machines are slow, and smtpserver sometimes sends a signal to
the old daemon, but then tries to bind to the SMTP port before the old
one dies. A quick fix is to give it a few seconds to exit, but to be
safe we should really send another signal to make sure it's gone.
*** 1.2 1992/08/12 01:25:30
--- killprev.c 1992/11/05 22:41:56
***************
*** 34,42 ****
else if (c == getpid())
(void) printf("was about to commit suicide\n");
else if ((sig < 0 && killpg(c, -sig) == 0 && sig == -SIGTERM)
! || (sig > 0 && kill(c, sig) == 0 && sig == SIGTERM))
printf("killed previous daemon%s = %d\n",
(sig > 0) ? ", pid" : "s, pgrp", c);
(void) fclose(fp);
}
if ((sig == 0 || sig == SIGTERM || -sig == SIGTERM)
--- 34,44 ----
else if (c == getpid())
(void) printf("was about to commit suicide\n");
else if ((sig < 0 && killpg(c, -sig) == 0 && sig == -SIGTERM)
! || (sig > 0 && kill(c, sig) == 0 && sig == SIGTERM)) {
printf("killed previous daemon%s = %d\n",
(sig > 0) ? ", pid" : "s, pgrp", c);
+ sleep(5); /* give process time to die */
+ }
(void) fclose(fp);
}
if ((sig == 0 || sig == SIGTERM || -sig == SIGTERM)