Skip to content

tentacle: debian: remove invoke-rc.d calls from postrm scripts - #67354

Merged
batrick merged 1 commit into
ceph:tentaclefrom
tchaikov:wip-tentacle-pr-66352
Apr 6, 2026
Merged

batrick merged 1 commit into
ceph:tentaclefrom
tchaikov:wip-tentacle-pr-66352

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

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 ([email protected], [email protected], 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.

(cherry picked from commit 505506adeebf86d6f950301d0adbfc65e87301c5)


backport of #66352

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added this to the tentacle milestone Feb 14, 2026
@tchaikov
tchaikov requested a review from cbodley February 14, 2026 06:17
@tchaikov

Copy link
Copy Markdown
Contributor Author

cc @ThomasLamprecht

@ThomasLamprecht

Copy link
Copy Markdown
Contributor

Looks good, but as all that's left is the #DEBHELPER# template stanza (plus shell shebang and set -e boilerplate), you can just drop the file completely, as then the debhelper will create it automatically as needed, i.e. if #DEBHELPER# wouldn't be empty.

@tchaikov

tchaikov commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@ThomasLamprecht thanks Thomas, seems I failed to backport the change properly, will fix it asap.

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
([email protected], [email protected], 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 <[email protected]>
(cherry picked from commit 4f48af0)
@tchaikov
tchaikov force-pushed the wip-tentacle-pr-66352 branch from 7590da3 to 2737540 Compare February 15, 2026 01:13
@tchaikov

Copy link
Copy Markdown
Contributor Author
[2026-02-15T02:48:27.000Z] [googletest] ceph_test_dokan failed. Error: Command timed out (1800s): "cmd /c 'C:\ceph\ceph_test_dokan.exe --gtest_output=xml:C:\workspace\test_results\out\ceph_test_dokan\ceph_test_dokan_results.xml  >> C:\workspace\test_results\out\ceph_test_dokan\ceph_test_dokan_results.log 2>&1'".

The only test failure is ceph_test_dokan, which timed out after 1800 seconds (30 minutes). This is a test for Dokan -- the Windows filesystem driver used for CephFS mounts on Windows. It's completely unrelated to the change in this pull request.

@tchaikov

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@amathuria

Copy link
Copy Markdown
Contributor

@batrick
batrick merged commit 45c133a into ceph:tentacle Apr 6, 2026
7 checks passed
@batrick batrick modified the milestones: tentacle, v20.2.2 Apr 6, 2026
@tchaikov
tchaikov deleted the wip-tentacle-pr-66352 branch April 7, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants