Sfoglia il codice sorgente

fix: the runner no longer refuses to start without a local webserver

The unit declared Requires=smartbotic-webserver.service, which assumes the two
always sit on the same host. With the webserver moved to another machine that
unit does not exist locally, systemd cannot satisfy the dependency, and the
runner will not start at all:

  Failed to restart smartbotic-runner.service:
  Unit smartbotic-webserver.service not found.

The requirement was not buying anything even in the single-host case. The
runner already tolerates the webserver being away - it reconnects node sync on
reconnect_interval_ms and re-registers on its heartbeat - which is exactly what
happens every time the webserver is restarted under it.

After= is kept so the start order is still right where both units are present,
and is ignored where the webserver is not.
fszontagh 3 settimane fa
parent
commit
339c993d66
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      systemd/user/smartbotic-runner.service

+ 7 - 1
systemd/user/smartbotic-runner.service

@@ -1,8 +1,14 @@
 [Unit]
 Description=SmartBotic Runner Service
 Documentation=https://github.com/smartbotic/smartbotic
+# Ordering only, deliberately not a Requires. The runner is built to survive
+# the webserver being absent - it retries node sync on reconnect_interval_ms
+# and re-registers on its heartbeat - so a hard requirement bought nothing even
+# when both ran on one host. It actively breaks a split deployment: with the
+# webserver on another machine the unit does not exist locally, and the runner
+# then refuses to start at all with "Unit smartbotic-webserver.service not
+# found". After= on a missing unit is simply ignored, which is what we want.
 After=network.target smartbotic-webserver.service
-Requires=smartbotic-webserver.service
 
 # Without PartOf, "systemctl restart smartbotic.target" starts nothing and
 # stops nothing: a target is only a grouping, and restart/stop do not reach