Detection of appropriate 'service' provider

84 views
Skip to first unread message

Dave F

unread,
Mar 27, 2018, 2:17:34 PM3/27/18
to Puppet Users
I'm using puppet to look after a mix of raspbian and gentoo OS's.  This is going pretty well so far - but I've hit an annoying issue that on the Gentoo OS, I'm seeing this:

Warning: Found multiple default providers for service: init, systemd; using init

which is annoying because my gentoo box is actually running systemd.  

I've had a look through the docs, and know that I can override this - possibly by using facts to find the OS version and then setting the provider attribute for any service resource I'm using - but this seems an overly complicated approach. 

What I can't do is find documentation on how/why puppet thinks my gentoo system is using init and systemd.  All the docs says is "You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform."

And in 5.5 documentation, there isn't even a provider attribute listed for services anyway. 

Any clue as to how/where puppet gets this from? So I can try and workout what's up with my Gentoo box that makes puppet thinks it's using init. 

Thanks
Dave

David Schmitt

unread,
Mar 28, 2018, 4:50:38 AM3/28/18
to puppet...@googlegroups.com
Look at the agent's --debug output. In the preamble there is a section on how providers get selected.

Cheers, David

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6285ba22-5e13-458e-8d93-bb123c7939ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Dave F

unread,
Mar 28, 2018, 11:54:08 AM3/28/18
to Puppet Users
Thanks for the hint David, but still stuck..

The relevant output from the gentoo box is:

Debug: Puppet::Type::Service::ProviderOpenrc: file /bin/rc-status does not exist
Debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does not exist
Debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist
Debug: Puppet::Type::Service::ProviderUpstart: 0 confines (of 4) were true
Debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist
Debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
Debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist
Debug: Puppet::Type::Service::ProviderRedhat: file /sbin/chkconfig does not exist
Debug: Puppet::Type::Service::ProviderOpenbsd: file /usr/sbin/rcctl does not exist
Warning: Found multiple default providers for service: init, systemd; using init

So it looks like it only displays the service providers it cannot find....
- so tried running it on one of the raspbian boxes which don't have init and are detecting systemd properly and i see:

Debug: Puppet::Type::Service::ProviderInit: false value when expecting true

Which really isn't telling me much about what's attempting to be detected, what's reporting false when the test is expecting true. 

Searching the github 'puppetlabs/puppet' repository for ProviderInit but found nothing - so I can't workout what part of the source code is doing the tests.

Dave


David Schmitt

unread,
Mar 29, 2018, 4:08:31 AM3/29/18
to puppet...@googlegroups.com
You can find the init provider here. Apparently it is very unconstrained, and therefore puppet prefers it over the systemd provider. It should be easy enough to change that to also exclude Gentoo, if it has switched to systemd now.


Cheers, David

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David Schmitt

unread,
Mar 29, 2018, 4:10:11 AM3/29/18
to puppet...@googlegroups.com
[Apologies for the double post]

The other option is to add Gentoo to the list of defaultfor's at https://github.com/puppetlabs/puppet/blob/0d5b6618b3a9a376625e5df86c349e1df2d88190/lib/puppet/provider/service/systemd.rb#L21


Cheers, David
Reply all
Reply to author
Forward
0 new messages