Skip to content

packaging: preremove.sh can never run — there is no packaging system to invoke it #207

Closed

Description

@scttfrdmn

scripts/preremove.sh is a working uninstall script — it stops and disables every objectfs@ systemd unit, then unmounts active mounts — and nothing references it. Grep across the entire repository for preremove returns only the file itself.

Compare scripts/postinstall.sh, which is referenced in four places (internal/config/config.go:633, internal/config/shipped_test.go:58, .github/workflows/ci.yml:301, CHANGELOG.md) because it is the script that installs /etc/objectfs/config.yaml.

The reason for the asymmetry: there is no packaging system in the repo at all. No nfpm.yaml, no deploy/, no packaging/, no spec file, no dpkg-deb/rpmbuild/fpm invocation anywhere. So postinstall.sh is referenced as documentation of a path that a package would install, and preremove.sh — which only a package manager can invoke, since it exists to run at removal time — is referenced by nothing because there is nothing to invoke it.

This belongs with the v0.11.0 install work, where it is a prerequisite rather than a loose end: #137 rewrites postinstall.sh for idempotency and #138 adds repository setup and install.sh. A package that installs cleanly and leaves mounted filesystems and enabled units behind on removal is worse than no package — an uninstall that does not unmount leaves a dead FUSE mount that requires manual fusermount -u to clear.

Do:

  • Land the packaging that consumes both scripts (nfpm is the low-friction choice for deb+rpm from one config), so preremove.sh runs at removal and postinstall.sh at install.
  • Review preremove.sh against the same idempotency standard B1-4: Rewrite postinstall.sh for idempotency and FUSE detection #137 applies to postinstall: it currently || trues every systemctl call, which is right for removal, but the unmount loop should be checked for the case where a mount is busy — failing removal is better than reporting success while a mount survives.
  • B2-2: Add Docker Compose and Kubernetes deployment manifests #146 notes deploy/ does not exist; that and this are the same gap seen from two directions.

Verification: the CI job #149 already proposes (full install-to-fstab on Rocky Linux 9) extended with an uninstall step that asserts no objectfs@ unit remains enabled and no objectfs mount remains in /proc/mounts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: buildarea: clieffort: smallpriority: mediumtype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions