Log permissions

I have setup my raspberry pi using your installation script. Everything worked as expected. I then followed some guides to put the /var/log directory into tmpfs. using this link:

On reboot the /var/log/needed_directories are written (by the script in the aforementioned link) and a new pihole.log file is created by the system.

The problem lies in that the new pihole.log file is permission 640 and causes the http://ip.address/admin web interface to break. The ads are still being blocked.

If I change the permissions to 644 on pihole.log the admin site works as expected.

The question then becomes, how do I make it so that the newly created on boot pihole.log file has the correct permissions on boot?

@mfreem2 ,
what script and how is it started as the stackexchange link got many replies ?

If a script is recreating those "/var/log/needed_directories" folders,
why not have it create the log file as well with proper ownership & permissions like so:

touch /var/log/pihole.log
chown dnsmasq:root /var/log/pihole.log
chmod 644 /var/log/pihole.log
# to make sure the log folder got right permissions:
chmod 755 /var/log

Ultimately, that is what I ended up doing. I am curious though, why without guidance the system creates the pihole.log file with permissions that break the web-server output? is it just because it is more secure that way? I thought maybe I was missing something in the standard file set that determined the file permissions.

Thanks for your input.

Just installed a fresh system - raspbian jessie lite february 2017 & pihole v2.13

permissions for /var/log: 755 - group root - owner root
permissions for /var/log/pihole.log: 644 - group root - owner dnsmasq