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
pihole.log permissions on tmpfs /var/log #1798
Comments
Is this a Pi-hole issue, or just an issue with using tmpfs? |
Thanks, I'm sorry I don't know to be honest. The error reported in The only thing I can think of that is slightly different / non-standard about my setup is my use of log2ram (included in armbian) which mounts /var/log as a tmpfs volume. I'll run some further tests this weekend disabling the fstab tmpfs mount and I'll report back with what I find. It might be worth me asking now if pihole is supported on with /var/log mounted as a tmpfs? I have searched but I couldn't find anything conclusive one way or the other. |
In the installer we set the permissions so
|
That's good to know, but what would happen on a "normal" system (not mine :)) if In this scenario what process creates the brand new |
It might set it to 640 dnsmasq:root automatically. However, in normal operation the log file is managed through logrotate, which keeps the permissions of the original log. |
Yes that aligns with what I see when I remove my init.d change and reboot. pihole.log is recreate, by dnsmasq I assume and is owned by dnsmasq, group root and no others can read:
Do you think a pull request for a change to the pihole-FTL init.d script would be accepted to make it more friendly to non-existence of the pihole.log file? |
Maybe, depends on how portable it is. Give it a go, and we'll review it. |
Cheers, #1817 is opened |
I see that #1817 has been merged to the development branch, thanks guys great work. Closing this down now. |
This change makes pihole more friendly to the non-existence of the pihole.log file. This can help with systems that are configured to mount /var/log as a tmpfs volume. It may also help with systems where the pihole.log file is accidentally/unintentionally removed. Further discussion around the details of this change are in #1798
In raising this issue, I confirm the following:
How familiar are you with the the source code relevant to this issue?:
1
Expected behaviour:
After initial install or upgrade and reboot of the device running pihole, pihole / pihole-FTL is able to fully start with no errors reported in pihole-FTL.log about permissions
Actual behaviour:
After initial install or upgrade and reboot of the device running pihole, pihole-FTL is unable to start and I see an error reported in
/var/log/pihole-FTL.log
related to lack of permissions to pihole.log:Although pihole-FTL was unable to start, ad blocking continues to work as expected.
Steps to reproduce:
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
pihole-FTL running
/var/log/pihole.log
in/var/log/pihole-FTL.log
(shown above in the "Actual behaviour" section)Troubleshooting undertaken, and/or other relevant information:
I've been able to fix this by manually modifying
/etc/init.d/pihole-FTL
so that/var/log/pihole.log
exists and permissions are modified so that the pihole user initially owns/var/log/pihole.log
on startup:Please note the parts that I've added to touch and chown
/var/log/pihole.log
here.This change appears to enable the pihole-FTL process to start with no issues however I note that after startup, the
/var/log/pihole.log
is owned by dnsmasq. This change is a permanent fix until pihole is upgraded because the/etc/init.d/pihole-FTL
init.d script is overwritten when pihole is upgraded.I "think" this issue could be related to me mounting
/var/log
on tmpfs which I do to prolong SD card life.I'm running pihole on a NanoPi Neo2 device which is running:
ARMBIAN 5.27 stable Ubuntu 16.04.2 LTS 4.11.1-sun50iw2
My current version:
Pi-hole Version v3.2 Web Interface Version v3.2 FTL Version vDev-437af07
I experienced this issue for the second time since initial install today when I upgraded to v3.2 and the upgrade rewrote/overwrote my manually adjusted
/etc/init.d/pihole-FTL
init.d scriptThanks!
The text was updated successfully, but these errors were encountered: