]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
debian: remove invoke-rc.d calls from postrm scripts 67354/head
authorKefu Chai <k.chai@proxmox.com>
Fri, 21 Nov 2025 11:50:26 +0000 (19:50 +0800)
committerKefu Chai <k.chai@proxmox.com>
Sun, 15 Feb 2026 01:13:35 +0000 (09:13 +0800)
commit27375400d0b0ca6e95f30ea29cc7472d89e1f318
treebfc0c3b7d6919cf466a58d85f3544cc49181e9e7
parentadc1923395f2bcd6ae89b5d331d278364d1848ed
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>
(cherry picked from commit 4f48af0d01472453b9388732fcd10997ee893929)
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]