diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-03 15:06:44 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-03 15:06:44 +0200 |
| commit | 13b9b9c3136a2d4859f6da799950e28d688e7dd0 (patch) | |
| tree | 04db5fddd06aa40065066c5503a7c9d78471f571 /packaging/deb/meshbay-hub/DEBIAN/prerm | |
| parent | 3a9f18aaa55df75e0ad91c4b3e2f2eb47369feda (diff) | |
| download | meshbay-13b9b9c3136a2d4859f6da799950e28d688e7dd0.tar.gz | |
fix(packaging): node and hub stop and clear their bytecode on removal
A node left running after removal recompiled bytecode into the shared venv,
and meshbay-common's cleanup ran too late for the node and hub directories:
dpkg warned that they were not empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packaging/deb/meshbay-hub/DEBIAN/prerm')
| -rwxr-xr-x | packaging/deb/meshbay-hub/DEBIAN/prerm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packaging/deb/meshbay-hub/DEBIAN/prerm b/packaging/deb/meshbay-hub/DEBIAN/prerm new file mode 100755 index 0000000..359e0a5 --- /dev/null +++ b/packaging/deb/meshbay-hub/DEBIAN/prerm @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +# A hub left running once its package is gone serves from deleted code, and +# keeps writing bytecode into the shared venv. +case "$1" in + remove|deconfigure) + if [ -d /run/systemd/system ]; then + systemctl stop meshbay-hub.service 2>/dev/null || true + fi + ;; +esac + +# The hub's code lives in meshbay-common's venv, and meshbay-common's own +# cleanup runs only after this package is gone: the bytecode compiled next to +# it is removed here, or dpkg cannot remove the directories it sits in. +case "$1" in + remove|upgrade|deconfigure) + find /opt/meshbay-common/venv/lib/python3.*/site-packages/meshbay_hub \ + -depth -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + ;; +esac + +#DEBHELPER# |