]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
debian: remove invoke-rc.d calls from postrm scripts 66352/head
authorKefu Chai <k.chai@proxmox.com>
Fri, 21 Nov 2025 11:50:26 +0000 (19:50 +0800)
committerKefu Chai <k.chai@proxmox.com>
Sat, 22 Nov 2025 14:26:38 +0000 (22:26 +0800)
commit4f48af0d01472453b9388732fcd10997ee893929
tree40b60f8a072522ad521bc88c391ca8b0cdddd30d
parentd8a62ea9256495c9867bc2bba57e48cce708c85a
debian: remove invoke-rc.d calls from postrm scripts

Previously, we called "invoke-rc.d ceph stop" in postrm scripts to
support sysvinit-based installations. However, this fails on systemd-
based systems, which are now the default on modern Debian distributions.

When invoke-rc.d detects systemd as the init system, it delegates to
systemctl, converting "invoke-rc.d ceph stop" to "systemctl stop
ceph.service". Since Ceph provides ceph.target and template units
(ceph-osd@.service, ceph-mon@.service, etc.) rather than a monolithic
ceph.service, this command always fails with exit code 5
(LSB EXIT_NOTINSTALLED).

This failure prevents the auto-generated cleanup sections added by
debhelper from executing properly, which can leave the system in an
inconsistent state during package removal.

Changes:

- Remove the invoke-rc.d call entirely. Systemd will handle service
  cleanup through its own mechanisms when the package is removed.
- Remove redundant "exit 0" statement (the script exits successfully
  by default, and "set -e" is no longer needed without commands that
  might fail).
- Remove vim modeline comment, as it's unnecessary for a 3-line script.
- Eventually remove this 3-line script stanza, as this is exactly what
  debhelper provides us.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
debian/ceph-base.prerm [deleted file]
debian/ceph-mds.prerm [deleted file]
debian/ceph-mgr.prerm [deleted file]
debian/ceph-mon.prerm [deleted file]
debian/ceph-osd.prerm [deleted file]