From: Kefu Chai Date: Fri, 21 Nov 2025 11:50:26 +0000 (+0800) Subject: debian: remove invoke-rc.d calls from postrm scripts X-Git-Tag: testing/wip-vshankar-testing-20260213.071255~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4f48af0d01472453b9388732fcd10997ee893929;p=ceph-ci.git 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 --- diff --git a/debian/ceph-base.prerm b/debian/ceph-base.prerm deleted file mode 100644 index 12e5da7d633..00000000000 --- a/debian/ceph-base.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# vim: set noet ts=8: - -set -e - -case "$1" in - remove) - invoke-rc.d ceph stop || { - RESULT=$? - if [ $RESULT != 100 ]; then - exit $RESULT - fi - } - ;; - - *) - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/ceph-mds.prerm b/debian/ceph-mds.prerm deleted file mode 100644 index 51f30d7f98e..00000000000 --- a/debian/ceph-mds.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# vim: set noet ts=8: - -set -e - -case "$1" in - remove) - invoke-rc.d ceph stop mds || { - RESULT=$? - if [ $RESULT != 100 ]; then - exit $RESULT - fi - } - ;; - - *) - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/ceph-mgr.prerm b/debian/ceph-mgr.prerm deleted file mode 100644 index 5e4bf42c2dd..00000000000 --- a/debian/ceph-mgr.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# vim: set noet ts=8: - -set -e - -case "$1" in - remove) - invoke-rc.d ceph stop mgr || { - RESULT=$? - if [ $RESULT != 100 ]; then - exit $RESULT - fi - } - ;; - - *) - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/ceph-mon.prerm b/debian/ceph-mon.prerm deleted file mode 100644 index a31fc3c2184..00000000000 --- a/debian/ceph-mon.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# vim: set noet ts=8: - -set -e - -case "$1" in - remove) - invoke-rc.d ceph stop mon || { - RESULT=$? - if [ $RESULT != 100 ]; then - exit $RESULT - fi - } - ;; - - *) - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/ceph-osd.prerm b/debian/ceph-osd.prerm deleted file mode 100644 index 93c459614e4..00000000000 --- a/debian/ceph-osd.prerm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# vim: set noet ts=8: - -set -e - -case "$1" in - remove) - invoke-rc.d ceph stop osd || { - RESULT=$? - if [ $RESULT != 100 ]; then - exit $RESULT - fi - } - ;; - - *) - ;; -esac - -#DEBHELPER# - -exit 0