diff --git a/src/freenas/etc/systemd/system/docker.service.d/override.conf b/src/freenas/etc/systemd/system/docker.service.d/override.conf index bb6637ec8facc..2da0ec0355239 100644 --- a/src/freenas/etc/systemd/system/docker.service.d/override.conf +++ b/src/freenas/etc/systemd/system/docker.service.d/override.conf @@ -1,8 +1,6 @@ [Unit] -# If the service fails mroe than once in 10 secs without -# ever hitting an active state, we will have systemd to stop retrying StartLimitBurst=1 -StartLimitIntervalSec=10 +StartLimitIntervalSec=900 [Service] ExecStartPost=/bin/sh -c "iptables -P FORWARD ACCEPT && ip6tables -P FORWARD ACCEPT" diff --git a/src/middlewared/middlewared/plugins/service_/services/docker.py b/src/middlewared/middlewared/plugins/service_/services/docker.py index 8c97b525e2e4f..797beee26a087 100644 --- a/src/middlewared/middlewared/plugins/service_/services/docker.py +++ b/src/middlewared/middlewared/plugins/service_/services/docker.py @@ -24,9 +24,10 @@ async def before_start(self): async def start(self): try: await super().start() - timeout = 120 # We have this at 120 because HDDs are notorious and docker can take more time there - # First time when docker is started, it takes a bit more time to initialise itself properly - # and we need to have sleep here so that after start is called post_start is not dismissed + # We have a timeout for docker to start within 15 minutes of the above call, if that doesn't happen + # then we get into a failed start that docker failed to start. This has been necessary because + # HDDs have been notorious and can take quite some time for docker to start on boot. + timeout = 8 * 60 # We do 8 because we sleep for 2 secs - so in total it is 16 minutes while timeout > 0: if not await self.middleware.call('service.started', 'docker'): await asyncio.sleep(2)