[Pkg-puppet-devel] Bug#854680: Bug#854680: Bug#854680: service resource cannot be disabled, spews error messages
Apollon Oikonomopoulos
apoikos at debian.org
Fri Feb 10 10:51:30 UTC 2017
Control: tags -1 severity serious
Hi,
On 17:51 Thu 09 Feb , Apollon Oikonomopoulos wrote:
> Control: retitle -1 puppet: service enable control broken when sysv-rc is not present
>
> On 14:22 Thu 09 Feb , Bernhard Schmidt wrote:
> > dpkg: error: --compare-versions takes three arguments: <version>
> > <relation> <version>
> >
> > Type dpkg --help for help about installing and deinstalling packages [*];
> > Use 'apt' or 'aptitude' for user-friendly package management;
> > Type dpkg -Dhelp for a list of dpkg debug flag values;
> > Type dpkg --force-help for a list of forcing options;
> > Type dpkg-deb --help for help about manipulating *.deb files;
> >
>
> This actually comes from a check against sysv-rc in the "debian" (aka
> update-rc.d/invoke-rc.d) provider. I'm just documenting this here (and
> changing the title), as switching the default to systemd will not
> trigger this.
Bumping this to RC, as sysv-rc is not installed by default anymore,
making the service provider unusable on a default Stretch installation.
I have prepared a fix with two different changes:
- Default to systemd as a service provider for all Debian versions. If
the system is not actually running on systemd (i.e. [ ! -d
/run/systemd/system ]), then it will fall back to the "debian"
provider.
- Remove the following check from lib/puppet/provider/service/debian.rb:
if `dpkg --compare-versions $(dpkg-query -W --showformat '${Version}' sysv-rc) ge 2.88 ; echo $?`.to_i == 0
update_rc @resource[:name], "disable"
else
update_rc "-f", @resource[:name], "remove"
update_rc @resource[:name], "stop", "00", "1", "2", "3", "4", "5", "6", "."
end
This check is irrelevant nowadays: update-rc.d is now in
init-system-helpers and the "disable" keyword is supported since at
least squeeze.
Regards,
Apollon
More information about the Pkg-puppet-devel
mailing list