fix(packaging): stop the service before the package is removed

Removing the package left the user service running from the deleted
binary, with ~/ProtonDrive still mounted. A user who then deleted the
folder to clean up had every file in it moved to the Proton Drive trash,
as any delete through the mount is.

The .deb (prerm on remove), the .rpm (%preun on erase) and the Arch
packages (pre_remove) now stop proton-drive.service for every user with
a running user manager, through runuser with that user's
XDG_RUNTIME_DIR, so no systemd-machined is needed. Upgrades are left
alone. Queued writes stay in the state directory for a later install.

The pacman install script lives once in packaging/ and the AUR
directories link it; push.sh copies its content into each AUR
repository. The uninstall guide now warns not to delete the mount point
while the service runs.

Reported on Reddit by a user who restored the files from the trash.
This commit is contained in:
nvrl committed 2026-10-12 00:07:07 +02:00
1 parent ee76f4ac60
commit e0442c56b9
21 files changed
+99 -5

No files matched your search

+2 -1
View File
@@ -13,7 +13,8 @@ The three packages conflict with each other and with the in-tree
`packaging/PKGBUILD` package (`proton-drive-linux`), and every one of them
`provides` `proton-drive-for-linux`, `proton-drive-linux`, and `pdfs`.
Each directory tracks only `PKGBUILD`, `.SRCINFO`, `.gitignore`, and `LICENSE`
Each directory tracks only `PKGBUILD`, `.SRCINFO`, `.gitignore`, `LICENSE` and
`proton-drive.install` (a link to `packaging/proton-drive.install`, copied as a file on push)
(the 0BSD license of the packaging sources, per
[RFC40](https://rfc.archlinux.page/0040-license-package-sources/)); the
`.gitignore` ignores everything else so downloaded sources, `src/`, `pkg/`, and