Skip to content

Commit

Permalink
Merge pull request #1486 from pi-hole/v6/fix-logrotate
Browse files Browse the repository at this point in the history
install the logrotate file into /etc/pihole at startup in case of volume mounting
  • Loading branch information
PromoFaux committed Nov 6, 2023
2 parents b9298ba + 7f89be5 commit ee4d73b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bash_functions.sh
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit ee4d73b

Please sign in to comment.