Commit 33847c40 authored by David Johnson's avatar David Johnson

Add a system-dependent pubsubd restart option for rc.bootsetup.

(Killing and manually starting pubsubd and relying on the system to
notice a new pid in the pidfile does not work for systemd.)
parent 662d7cd9
......@@ -67,6 +67,7 @@ my $BOOTLOG = "/var/log/emulab.bootlog";
my %TMCCTIMEOUT = (REMOTE() ? ("timeout" => 5) : ());
my $PUBSUBCONF = "/usr/local/etc/pubsubd.conf";
my $PUBSUBEXPR = "/usr/local/etc/pubsubd.expr";
my $PUBSUBD_RESTART = "/usr/local/etc/emulab/pubsubd.restart";
# Protos.
sub doboot();
......@@ -451,7 +452,13 @@ sub doboot()
#
# Kill off pubsubd and restart in cluster mode.
#
if (-x "/usr/local/libexec/pubsubd") {
if (-x $PUBSUBD_RESTART) {
print("Restarting pubsubd...\n");
system($PUBSUBD_RESTART);
if ($?) {
fatal("Error restarting pubsubd");
}
} elsif (-x "/usr/local/libexec/pubsubd") {
system("killall pubsubd");
my $ws = 8;
while ($ws > 0
......
......@@ -295,6 +295,10 @@ sysetc-install-systemd: systemd-dir-install
$(SYSETCDIR)/systemd/system/multi-user.target.wants/testbed.service
ln -sf ../emulab-fstab-fixup.service \
$(SYSETCDIR)/systemd/system/multi-user.target.wants/emulab-fstab-fixup.service
# Install our pubsubd.restart helper
$(INSTALL) -m 755 -o root -g $(DIRGROUP) \
$(SRCDIR)/pubsubd.restart-systemd \
$(BINDIR)/pubsubd.restart
# Kick the init process to read our newly-installed unit files
# (i.e., so an immediate tbprepare will work...)
-@if [ -z "$(DESTDIR)" ]; then \
......
#!/bin/sh
exec systemctl restart pubsubd.service
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