[Pkg-puppet-devel] Bug#775795: Patch to use /usr/sbin/service in Debian service provider
Faidon Liambotis
paravoid at debian.org
Fri Feb 6 13:49:17 UTC 2015
reopen 775795
thanks
On 02/01/15 01:03, Gaudenz Steinlin wrote:
> I created a patch to use /usr/sbin/service as suggested earlier in this
> report to start/stop/status/restart services on Debian. I'm a bit
> reluctant to just NMU puppet and would prefer if one of the maintainers
> and/or Faidon could have a look at my patch first. If you approve I can
> then do the NMU if you are short on time.
>
> I tested the patch locally and as far as I can see it works fine with
> systemd and does call the right command. I don't have a system with
> system V handy to test on.
Apologies, it seems like I didn't review this on time...
This seems like a nice approach for status/start/stop/restart but
unfortunately doesn't address enabled?/enable/disable at all. For
starters, puppet seems to call update-rc.d with "defaults", not
"enable". Even "enable", though, does not seem to be sufficient for
systemd-only service files :(
Try this:
# cp /etc/systemd/system/ssh.service /etc/systemd/system/test.service
# systemctl daemon-reload
# update-rc.d -f test defaults
update-rc.d: error: initscript does not exist: /etc/init.d/test
# update-rc.d -f test enable
update-rc.d: error: cannot find a LSB script for test
enabled? is similarly broken: it calls invoke-rc.d --query, which
returns 105 for test.service and puppet handles 105 by proceeding to
check for symlinks under /etc/rc*.d/...
Finally, self.instances is also broken, as it just lists /etc/init.d
init files. The systemd provider calls "systemctl list-unit-files --type
service --full --all" instead.
Honestly, I'd just switch the default provider for Debian 8+ to systemd
and let users who use a non-default init system handle it in their
manifest by supplying provider => debian or provider => upstart.
Faidon
More information about the Pkg-puppet-devel
mailing list