From db1431a1ae9bb796dc1a2e381f0a565c385d7c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 27 Jul 2024 22:25:45 +0200 Subject: [PATCH 1/2] Remove obsolet files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .stickler.yml | 10 ---------- .yamllint.conf | 3 --- advanced/Templates/pihole-FTL.conf | 2 -- 3 files changed, 15 deletions(-) delete mode 100644 .stickler.yml delete mode 100644 .yamllint.conf delete mode 100644 advanced/Templates/pihole-FTL.conf diff --git a/.stickler.yml b/.stickler.yml deleted file mode 100644 index 5fdbbf1e..00000000 --- a/.stickler.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -linters: - shellcheck: - shell: bash - phpcs: - flake8: - max-line-length: 120 - yamllint: - config: ./.yamllint.conf - remarklint: diff --git a/.yamllint.conf b/.yamllint.conf deleted file mode 100644 index d1b0953b..00000000 --- a/.yamllint.conf +++ /dev/null @@ -1,3 +0,0 @@ -rules: - line-length: disable - document-start: disable diff --git a/advanced/Templates/pihole-FTL.conf b/advanced/Templates/pihole-FTL.conf deleted file mode 100644 index 269fcf9d..00000000 --- a/advanced/Templates/pihole-FTL.conf +++ /dev/null @@ -1,2 +0,0 @@ -#; Pi-hole FTL config file -#; Comments should start with #; to avoid issues with PHP and bash reading this file From 1ed5994fa575c95201df0259282b563195077e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 28 Jul 2024 13:01:41 +0200 Subject: [PATCH 2/2] Remove temporal log file symlink code. It was introduced 2 years ago with v5.11 and always thought to be temporarily only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Templates/pihole-FTL-prestart.sh | 12 ---------- automated install/basic-install.sh | 28 ----------------------- 2 files changed, 40 deletions(-) diff --git a/advanced/Templates/pihole-FTL-prestart.sh b/advanced/Templates/pihole-FTL-prestart.sh index d807b81c..c604d5d4 100755 --- a/advanced/Templates/pihole-FTL-prestart.sh +++ b/advanced/Templates/pihole-FTL-prestart.sh @@ -32,15 +32,3 @@ find /etc/pihole -type d -exec chmod 0755 {} \; [ -f /var/log/pihole/FTL.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/FTL.log [ -f /var/log/pihole/pihole.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/pihole.log [ -f /etc/pihole/dhcp.leases ] || install -m 644 -o pihole -g pihole /dev/null /etc/pihole/dhcp.leases - - -# Backward compatibility for user-scripts that still expect log files in /var/log instead of /var/log/pihole -# Should be removed with Pi-hole v6.0 -if [ ! -f /var/log/pihole.log ]; then - ln -sf /var/log/pihole/pihole.log /var/log/pihole.log - chown -h pihole:pihole /var/log/pihole.log -fi -if [ ! -f /var/log/pihole-FTL.log ]; then - ln -sf /var/log/pihole/FTL.log /var/log/pihole-FTL.log - chown -h pihole:pihole /var/log/pihole-FTL.log -fi diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ef891ec4..ab3a2290 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2323,34 +2323,6 @@ main() { # the service before enabling causes installer to exit enable_service pihole-FTL - # If this is an update from a previous Pi-hole installation - # we need to move any existing `pihole*` logs from `/var/log` to `/var/log/pihole` - # if /var/log/pihole.log is not a symlink (set during FTL startup) move the files - # can be removed with Pi-hole v6.0 - # To be sure FTL is not running when we move the files we explicitly stop it here - - stop_service pihole-FTL &>/dev/null - - if [ ! -d /var/log/pihole/ ]; then - mkdir -m 0755 /var/log/pihole/ - fi - - # Special handling for pihole-FTL.log -> pihole/FTL.log - if [ -f /var/log/pihole-FTL.log ] && [ ! -L /var/log/pihole-FTL.log ]; then - # /var/log/pihole-FTL.log -> /var/log/pihole/FTL.log - # /var/log/pihole-FTL.log.1 -> /var/log/pihole/FTL.log.1 - # /var/log/pihole-FTL.log.2.gz -> /var/log/pihole/FTL.log.2.gz - # /var/log/pihole-FTL.log.3.gz -> /var/log/pihole/FTL.log.3.gz - # /var/log/pihole-FTL.log.4.gz -> /var/log/pihole/FTL.log.4.gz - # /var/log/pihole-FTL.log.5.gz -> /var/log/pihole/FTL.log.5.gz - for f in /var/log/pihole-FTL.log*; do mv "$f" "$(sed "s/pihole-/pihole\//" <<<"$f")"; done - fi - - # Remaining log files - if [ -f /var/log/pihole.log ] && [ ! -L /var/log/pihole.log ]; then - mv /var/log/pihole*.* /var/log/pihole/ 2>/dev/null - fi - restart_service pihole-FTL # Download and compile the aggregated block list