Skip to content

refactor(service/systemd): remove Debian SysVInit compatibility fallback - #562

Open
TheMeier wants to merge 1 commit into
OpenVoxProject:mainfrom
TheMeier:systemd-debian
Open

refactor(service/systemd): remove Debian SysVInit compatibility fallback#562
TheMeier wants to merge 1 commit into
OpenVoxProject:mainfrom
TheMeier:systemd-debian

Conversation

@TheMeier

Copy link
Copy Markdown

The systemd provider no longer falls back to invoke-rc.d/init script inspection to determine whether a service is enabled.

Short description

The systemd provider no longer falls back to invoke-rc.d/init script inspection to determine whether a service is enabled.

Checklist

I have:

Copilot AI review requested due to automatic review settings July 23, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the Debian SysVInit compatibility fallback from the systemd service provider, so enabled? relies solely on systemctl is-enabled results rather than inspecting init-script state via invoke-rc.d and rc.d start links.

Changes:

  • Removed Debian-specific SysVInit enable-state probing (invoke-rc.d + rc.d link counting) from the systemd provider.
  • Simplified enabled? behavior to return :false for non-zero systemctl is-enabled exit codes (except for the existing masked/indirect handling).
  • Updated unit tests by removing Debian fallback expectations and deleting specs for the removed helper methods.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spec/unit/provider/service/systemd_spec.rb Removes tests that asserted Debian SysVInit fallback behavior and helper-method behavior that no longer exists.
lib/puppet/provider/service/systemd.rb Removes debian_enabled? / get_start_link_count and the Debian fallback branch from enabled?.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The systemd provider no longer falls back to invoke-rc.d/init script
inspection to determine whether a service is enabled.

Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
Copilot AI review requested due to automatic review settings July 27, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 343 to 347
it "should consider nonexistent services to be disabled" do
provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'doesnotexist'))
allow(Facter).to receive(:value).with('os.family').and_return('debian')
expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'doesnotexist'], {:failonfail => false})
.and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))
expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail => false})
.and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))

return ret if ret
end

:false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants