Point of service resource *_command attrs?


#1

I can’t figure out what the *_command attributes are actually for.

Setting init_command, start_command … etc… to a value seems
pointless when the chosen underlying provider has all of its hardcoded
information that it uses.

service ‘foo’ do
init_command '/bin/true’
start_command '/bin/true’
action [:enable, :start]
end

==> “unable to locate the init.d script!”

Any ideas?


Jeff Blaine
kickflop.net
PGP/GnuPG Key ID: 0x0C8EDD02


#2

On Friday, November 21, 2014 at 1:33 PM, Jeff Blaine wrote:

I can’t figure out what the *_command attributes are actually for.

Setting init_command, start_command … etc… to a value seems
pointless when the chosen underlying provider has all of its hardcoded
information that it uses.

service ‘foo’ do
init_command '/bin/true’
start_command '/bin/true’
action [:enable, :start]
end

==> “unable to locate the init.d script!”

Any ideas?
Probably need to set the status command so chef can tell whether it needs to start the service. Also, the enable action may be problematic if you’re not following your init system’s conventions.


Jeff Blaine
kickflop.net (http://kickflop.net)
PGP/GnuPG Key ID: 0x0C8EDD02


Daniel DeLeo


#3

On 11/21/14, 1:33 PM, Jeff Blaine wrote:

I can’t figure out what the *_command attributes are actually for.

Setting init_command, start_command … etc… to a value seems
pointless when the chosen underlying provider has all of its hardcoded
information that it uses.

service ‘foo’ do
init_command '/bin/true’
start_command '/bin/true’
action [:enable, :start]
end

==> “unable to locate the init.d script!”

Any ideas?

I think there’s some outstanding bugs where the providers assume they
know best, and really need to respect the resource attributes given by
the user so that the user can override. Those are just bugs in the
provider implementation. However, I don’t have any good workaround
suggestions other than submitting pull-requests and unfortunately don’t
have the bandwidth right now.


#4

Hi,

You might have luck setting the provider for the resource to
Chef::Provider::Service::Simple. You’ll need to specify a command for
any action you want. And, unfortunately, the Simple provider doesn’t
have a hook for the enable action, so you would need to change your
action to just :start. Definitely looks like there is some cleanup to
do in the service provider implementations there.

On Sat, Nov 22, 2014 at 1:19 AM, Lamont Granquist lamont@opscode.com wrote:

On 11/21/14, 1:33 PM, Jeff Blaine wrote:

I can’t figure out what the *_command attributes are actually for.

Setting init_command, start_command … etc… to a value seems
pointless when the chosen underlying provider has all of its hardcoded
information that it uses.

service ‘foo’ do
init_command '/bin/true’
start_command '/bin/true’
action [:enable, :start]
end

==> “unable to locate the init.d script!”

Any ideas?

I think there’s some outstanding bugs where the providers assume they know
best, and really need to respect the resource attributes given by the user
so that the user can override. Those are just bugs in the provider
implementation. However, I don’t have any good workaround suggestions other
than submitting pull-requests and unfortunately don’t have the bandwidth
right now.