Commit a3b1a555 authored by David Johnson's avatar David Johnson

Fix a race in kill/restart of pubsubd in rc.bootsetup .

pubsubd wasn't restarting, surely because the existing pubsubd was still
running and/or socket state was still live in the kernel even after
putative death.  This took a long time to manifest, and it's not clear
exactly what the problem was, but making sure pubsubd is dead (and is no
longer holding its specific port) is appropriate even if we assume
REUSEADDR is working, and fixes the current problem.  This was only
observable on the pc3000s and c220g2s, as far as I saw.
parent c5ee65fa
......@@ -453,6 +453,13 @@ sub doboot()
#
if (-x "/usr/local/libexec/pubsubd") {
system("killall pubsubd");
my $ws = 8;
while ($ws > 0
&& system("killall -0 pubsubd >/dev/null 2>&1") == 0) {
print("Waiting for pubsubd to exit...\n");
sleep(1);
$ws -= 1;
}
print("Starting pubsubd in cluster mode\n");
system("/usr/local/libexec/pubsubd $clusteringoptions");
if ($?) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment