Aha that's better. I didn't think about that . Should I refactor and
resubmit?
Op 10 feb. 2013 10:27 schreef "Stefan Schulte" <notifications@github.com>
het volgende:

> In lib/puppet/provider/service/systemd.rb:
>
> > @@ -1,11 +1,18 @@
> >  # Manage systemd services using /bin/systemctl
> >
> >  Puppet::Type.type(:service).provide :systemd, :parent => :base do
> > -  desc "Manages `systemd` services using `/bin/systemctl`."
> > -
> > -  commands :systemctl => "/bin/systemctl"
> > +  desc "Manages `systemd` services using `/bin/systemctl` or `/usr/bin/systemctl`."
> > +
> > +  if File.exists?("/bin/systemctl")
> > +    commands :systemctl => "/bin/systemctl"
> > +  else
> > +    if File.exists?("/usr/bin/systemctl")
>
> Before your change puppet treated the provider unsuitable if
> /bin/systemctl has been absent (the command method creates a confine for
> that provider, telling puppet that the command has to exist for the
> provider to work). Now you wrap that in an if clause but if neither
> /bin/systemctl nor /usr/bin/systemctl exist the new code does not declare
> any confine. So puppet can happily pick the provider for service resources
> on systems that don't have systemd installed.
>
> Maybe you can change that to something like
>
> systemctl_binary = File.executable?('/usr/bin/systemctl') ? '/usr/bin/systemctl' : '/bin/systemctl'
> commands :systemctl => systemctl_binary
>
> so you will always declare a confine. If /usr/bin/systemctl is present
> use this command otherwise /bin/systemctl. If that one is also absent,
> puppet will treat the provider as unsuitable
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/puppetlabs/puppet/pull/1157/files#r2954792>..
>
>