Fresh Pi-hole deployment rebooting constantly after startup

Hello, friends. I just setup my first balena Pi-hole after reading several guides, ultimately following balena’s tutorial. I’ve previously run Pi-hole in a docker container on my NAS, but created a bootstrap problem for myself there!

In this deployment, DNSCrypt and Pi-hole both start, but then the Pi-hole service restarts continually after a failure in the start script. Here are my logs for the relevant timeframe. The admin page does not load, and nslookup queries time out. It looks like a missing file may be the cause, but I cannot tell. Could somebody please help me resolve this failure?


12.01.20 06:25:42 (-0500) pihole [✓] DNS service is running
12.01.20 06:25:42 (-0500) pihole [✓] Pi-hole blocking is Enabled
12.01.20 06:25:42 (-0500) pihole [cont-init.d] exited 0.
**12.01.20 06:25:42 (-0500) pihole [cont-init.d] executing… **
: No such file or directorypihole ifelse: fatal: unable to exec bash
12.01.20 06:25:42 (-0500) pihole [cont-init.d] exited 111.
12.01.20 06:25:42 (-0500) pihole [cont-finish.d] executing container finish scripts…
12.01.20 06:25:42 (-0500) pihole [cont-finish.d] done.
12.01.20 06:25:42 (-0500) pihole [s6-finish] syncing disks.
12.01.20 06:25:43 (-0500) pihole [s6-finish] sending all processes the TERM signal.
12.01.20 06:25:46 (-0500) pihole [s6-finish] sending all processes the KILL signal and exiting.
12.01.20 06:25:47 (-0500) Service exited 'pihole sha256:fefcdfcdfe6d445b11b21639e382717af58fc642aa3f042f4e8e6c7d1f392674’
12.01.20 06:25:50 (-0500) Restarting service ‘pihole sha256:fefcdfcdfe6d445b11b21639e382717af58fc642aa3f042f4e8e6c7d1f392674’
12.01.20 06:25:46 (-0500) pihole [s6-finish] sending all processes the KILL signal and exiting.
12.01.20 06:25:49 (-0500) pihole [s6-init] making user provided files available at /var/run/s6/etc…exited 0.
12.01.20 06:25:49 (-0500) pihole [s6-init] ensuring user provided files have correct perms…exited 0.
12.01.20 06:25:49 (-0500) pihole [fix-attrs.d] applying ownership & permissions fixes…
12.01.20 06:25:49 (-0500) pihole [fix-attrs.d] 01-resolver-resolv: applying…
12.01.20 06:25:49 (-0500) pihole [fix-attrs.d] 01-resolver-resolv: exited 0.
12.01.20 06:25:49 (-0500) pihole [fix-attrs.d] done.
12.01.20 06:25:49 (-0500) pihole [cont-init.d] executing container initialization scripts…
12.01.20 06:25:49 (-0500) pihole [cont-init.d] executing…
12.01.20 06:25:50 (-0500) pihole ::: Starting docker specific checks & setup for docker pihole/pihole
12.01.20 06:25:50 (-0500) pihole OK: Checks passed for /etc/resolv.conf DNS servers

Hi, I found the following same issue already resolved by someone else:

Please let us know whether this solves the issue for you.

You may check that project as well in case you did not yet.


Thanks, I did try the method noted in that Github issue. I downloaded the zip file, extracted it directly to a folder, and then re-ran balena push <AppName>. It deployed the code without errors and then continued the same behavior.

Hey @SturdyErde welcome to the forums :slight_smile:
Could you confirm if you are cloning and pushing from windows as well?

Yes. I removed my local copy of the repo to make sure the Windows line break characters were removed, downloaded and extracted the, and then ran balena push from within the extracted folder.

Also, before running the push command, I ran git config --global core.autocrlf true to fix how Windows handled the line ends. Am I still missing something?

Finally got the Pi-hole working after reading through another thread. For whatever reason, downloading the ZIP file instead of cloning still did not work, so the final solution was to delete the script file. With very little Linux experience under my belt, I searched and found the following commands to run:

find . -name
rm <path to filename]

And then restart the pi-hole service.

Hey @SturdyErde, good to hear that you got it working!

I’m not sure myself why that file would cause an issue. I’ll raise this with my teammate who helps with the maintenance of this project. I see that you raised this issue with the author of the repo – which is good!

Hello again, my teammate, Chris, just confirmed that this file (/pihole/init/ seems like having line ending issues. As you already raised this to the author of the repo, we’ll let the repo maintainer to address it.

Thanks for your responses! Hopefully the repo maintainer can find a simple solution. This is a great first project for Pi/balena users.