Merge pull request #1486 from pi-hole/v6/fix-logrotate

install the logrotate file into /etc/pihole at startup in case of volume mounting
This commit is contained in:
Adam Warner 2023-11-06 21:57:53 +00:00 committed by GitHub
commit ee4d73be63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,7 @@ ensure_basic_configuration() {
touch /var/log/pihole/FTL.log /var/log/pihole/pihole.log
chown -R pihole:pihole /var/run/pihole /var/log/pihole
if [[ -z "${PYTEST}" ]]; then
if [[ ! -f /etc/pihole/adlists.list ]]; then
echo "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" >/etc/pihole/adlists.list
@ -54,6 +55,11 @@ ensure_basic_configuration() {
setFTLConfigValue "files.macvendor" "/macvendor.db"
chown pihole:pihole /macvendor.db
fi
# Install the logrotate config file - this is done already in Dockerfile
# but if a user has mounted a volume over /etc/pihole, it will have been lost
# pihole-FTL-prestart.sh will set the ownership of the file to root:root
install -Dm644 -t /etc/pihole /etc/.pihole/advanced/Templates/logrotate
}
setup_web_password() {