diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/daemon.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/daemon.py b/packages/meshbay-node/src/meshbay_node/daemon.py index 8f9307c..3a024f0 100644 --- a/packages/meshbay-node/src/meshbay_node/daemon.py +++ b/packages/meshbay-node/src/meshbay_node/daemon.py @@ -1599,9 +1599,23 @@ def _systemctl_user(verb: str, unit: str, *, not_running_hint: str, signalling it, respawning it — is a second, worse implementation of what systemd is already doing, and pattern-matching a process list has already hit a real developer's real running node by accident. + + Reloads the user manager's view of unit files first. The package + installers (deb postinst, rpm %post) run as root and can only reload the + *system* manager — a different process from any signed-in user's *user* + manager, which is the one that actually owns this unit — so a package + upgrade leaves that manager still holding the old unit file and prints a + warning naming the exact fix. Doing it here runs it under the right + privilege, the user's own, right before the command that would otherwise + act on a stale definition. Best-effort and unchecked: a reload the + manager did not need must never block what the operator actually asked + for, and a genuine problem still surfaces from the verb below. """ import subprocess + subprocess.run(["systemctl", "--user", "daemon-reload"], + capture_output=True, text=True) + result = subprocess.run(["systemctl", "--user", verb, unit], capture_output=True, text=True) if result.returncode != 0: |