Thermatix
Thermatix

Reputation: 2929

Can't get service to start on chef

I have a service resource but I can't get chef to start it, instead chef just spits out an error message:

SystemCallError: The specified service does not exist as an installed service. - OpenService: The specified service does not exist as an installed service.

I'm not sure what to do to fix this and I can't find anything on this error (could be I'm not looking in the right place).

The service is distributed as a gem that's installed. The service itself is a Sinatra app that uses the win32-service gem to start it as a service The platform is windows server (I know but I have no choice, I have to use windows server)

The code in the chef recipe for this service is:

service service_name do
  init_command ("#{%x(gem env gemdir).strip.gsub('/','\\')}\\gems\\#{service_name}-#{installing_version}")
  start_command "rake service:start"
  stop_command "rake service:stop"
  reload_command "rake service:reload"
  restart_command "rake service:restart"
  supports start: true, restart: true, reload: true
  action [:enable,:start]
end

Upvotes: 0

Views: 954

Answers (1)

Tejay Cardon
Tejay Cardon

Reputation: 4223

The issue is not with Chef, but with your service itself. Typically when I'm in this situation, I will login manually and attempt to start the service. Sometimes that will give you additional information. Also, take a look at the log files for your app and see if you can figure out why it's not starting.

Ultimately, Chef just calls your init and start commands, but it can't do much if those commands fail.

Upvotes: 1

Related Questions