Skip to content
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

Disable cron for "Stopped" services #9

Open
ghost opened this issue Sep 8, 2016 · 4 comments
Open

Disable cron for "Stopped" services #9

ghost opened this issue Sep 8, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 8, 2016

While debugging (or calming backend services) I sometimes need to temporarily disable a cron-ed service.

I tried setting the service to "Stopped" but rancher-cron runs the service anyway. My current workaround is to "upgrade" services and change the rancher-cron label to something like 'off....' to preserve the crontab entry format but disable.

It would be ideal if rancher-cron could poll the api and not start cron services if they are "Stopped"

@smazurov
Copy link
Contributor

smazurov commented Sep 8, 2016

Good idea, thats easy enough, just add a check here and "continue" if service.status is stopped.

I'm pretty busy at the moment, I plan to certainly address it in the future, otherwise PRs are welcome!

@jmloeffler
Copy link
Contributor

I took a quick look at this. At first glance I'd say the major hangup is that the rancher-metadata service does not expose the state of the service. It only does so for containers and that's not helpful because the containers themselves are naturally going to be stopped most of the time.

@smazurov
Copy link
Contributor

smazurov commented Nov 16, 2016

Yeah, metadata might not be the best option for this - its great to quickly get a container with a specific label, but not much else (for this use case). Rancher API does have ability to get Service by Id (service.uuid) and Service has HealthState

@jmloeffler
Copy link
Contributor

Any chance of rolling out a new release so that these changes are available in the official image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants