]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
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)
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]

diff --git a/debian/ceph-base.prerm b/debian/ceph-base.prerm
deleted file mode 100644 (file)
index 12e5da7..0000000
+++ /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 (file)
index 51f30d7..0000000
+++ /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 (file)
index 5e4bf42..0000000
+++ /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 (file)
index a31fc3c..0000000
+++ /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 (file)
index 93c4596..0000000
+++ /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