Skip to content

feat(release): removing the .deb stops the background service - #104

Merged
httpsphl merged 1 commit into
mainfrom
feat/deb-prerm
Oct 2, 2026
Merged

httpsphl merged 1 commit into
mainfrom
feat/deb-prerm

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Closes the other Linux gap (spec 15.4): removing the .deb now stops Botloft's background service, as the NSIS uninstall hook does on Windows.

  • app/src-tauri/linux/prerm.sh is wired as the .deb's preRemoveScript. dpkg runs it as root; it acts only on remove or purge. The in-app updater installs a new .deb, which calls it with upgrade, and that leaves everything alone.
  • For each ~/.config/systemd/user/botloft.service in /home/* and /root:
    • If the user's manager is up, it runs botloftd --home ~/.local/share/Botloft service uninstall as that user (runuser, with HOME, XDG_RUNTIME_DIR and their session bus).
    • Either way, it removes the unit, its default.target.wants link and ~/.config/autostart/botloft.desktop, which covers users who are signed out.
    • Bots and data stay.
  • The AppImage and the macOS app have no uninstaller; the docs keep the manual step for them.
  • The README and the code signing policy describe 0.8.0, so they change with the next release.

Tests

  • Debian container, as root, with two made-up users and a fake botloftd that records its call:
    • upgrade changes nothing.
    • remove calls ana's daemon as ana, with her home, runtime dir and data folder; bob has no session and only loses the files.
    • No service or sign-in file is left, and the data stays.
  • Release dry run (run 36954348480): the built .deb carries prerm, mode 0755.

Manual test (not done yet)

On Ubuntu: install the .deb, open Botloft, then sudo apt remove botloft. systemctl --user status botloft should no longer find the unit, and no botloftd should run.

A prerm script does what the NSIS uninstall hook does on Windows: on
remove or purge, and not on the upgrades the in-app updater installs, it
runs botloftd service uninstall as each user who has the service and
removes the service and sign-in entries. Bots and data stay.
@httpsphl
httpsphl enabled auto-merge October 2, 2026 02:25
@httpsphl
httpsphl merged commit b512b72 into main Oct 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant