-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service issue due to status_command... #8
Comments
For completeness sake I'll mention that I ended up editting/overriding the init.d template so that the service command (in linux) and it also fixes using the service resource in chef (otherwise the service resource status command could be given/overridden when the service resource is setup). Only thing I had to change in init.d was the status section. Mine now looks like: status) I did a little slight of hand so the linux std still sees the output from eye info command and I can still grep it "| tee /dev/stderr" and then "> /dev/null" is so that line isn't displayed 2x. I'd be more than happy to do a fork-pull if you're interested |
you can check exit status by |
@bradenwright yes, I'm interested, thank you! but one thing.. your regex isn't working for me
And there are other states like 'restarting' or 'unmonitored', which aren't handled by your regex |
After @kostya suggestion I ended up going with
I'll take a look at the details of how best to pass the process_name, etc and make a fork pull request since seems like you are interested & it should cover all states as well. |
I fixed my own issue but figured I'd leave the detail here. I noticed that I was having issues with using the service and starting/stopping. Issue came down to the fact that "eye info" command always returns 0 whether the app is running or not.
I think the issue can be fixed by changing:
def status_command
"#{node['eye']['bin']} info #{new_resource.service_name}"
end
to
def status_command
"#{node['eye']['bin']} info #{new_resource.service_name} | grep '[[:alnum:]]+ [.]+ (up|starting)'"
end
essentially I tried to match as detailed as possible to make sure that something is starting (if alpha numberic isn't general enough then that part could be cut out.
execute info $SERVICE_NAME | tee /dev/stderr | grep '[[:alnum:]]+ [.]+ (up|starting)' > /dev/null
The text was updated successfully, but these errors were encountered: