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

OwnCloud doesn't automatically start with Rock-On service restart #1132

Closed
schakrava opened this issue Jan 27, 2016 · 2 comments
Closed

OwnCloud doesn't automatically start with Rock-On service restart #1132

schakrava opened this issue Jan 27, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@schakrava
Copy link
Member

See (2) in http://forum.rockstor.com/t/rock-on-service-restart-issues/979

@schakrava schakrava added the bug label Jan 27, 2016
@schakrava schakrava self-assigned this Jan 27, 2016
@schakrava schakrava added this to the Kilauea Iki milestone Jan 27, 2016
@schakrava
Copy link
Member Author

The reason is combination of the docker restart policy we use and how apps exit out. Here's the doc about restart-policies: https://docs.docker.com/engine/reference/run/#restart-policies-restart

Currently, we use on-failure:5. So when the docker service starts, if a container exited with non-zero code, it will be restarted up to 5 times or until it starts successfully -- whichever happens first. This doesn't seem to be working well because the exit code is set by the app and so, not standardized. For example, say owncloud and btsync rock-ons are both running. If the service is stopped, owncloud is gracefully exits with exitcode 0, where as btsync exits with 137. And when the service started again, the current restart policy start btsync but not owncloud, because of it's graceful exit(even as we just turn off the docker/rock-on service).

On the other extreme, we have btsync which always seem to exit with exitcode 137, whether it's stopped explicitly or if the service is stopped. So btsync always starts up upon docker service start.

I think a better docker restart policy to use is unless-stopped. This policy is independent of exit codes that are set by individual apps. And those that are explicitly stopped will not be attempted to start again on docker service start whereas those that were not stopped explicitly will be. The one side effect to note is that, docker will attempt restart forever, though doubling pause time between each attempt. I think this is fine.

@schakrava
Copy link
Member Author

Change default restart policy to unless-stopped

schakrava added a commit that referenced this issue Feb 18, 2016
change docker restart policy to unless-stopped. Fixes #1132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant