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>
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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
+++ /dev/null
-#!/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