Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
OwnCloud doesn't automatically start with Rock-On service restart #1132
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.