Skip to content
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

[Tracking] Log symlinks /var/log -> /var/log/pihole need to be removed #4750

Open
yubiuser opened this issue May 31, 2022 · 3 comments
Open
Labels
Bug: Confirmed Verified as a bug to be resolved

Comments

@yubiuser
Copy link
Member

#3732 changed the default log location from /var/log/ to /var/log/pihole. To ensure backward compatibility we created symlinks for /var/log/pihole.log -> /var/log/pihole/pihole.log and /var/log/pihole-FTL.log -> /var/log/pihole/pihole-FTL.log.

Those links (and the code) should be removed in an upcoming version. Marking this Bug to preventing it from going stale.

@yubiuser yubiuser added the Bug: Confirmed Verified as a bug to be resolved label May 31, 2022
@yubiuser
Copy link
Member Author

yubiuser commented Jul 3, 2022

#4777 changed FTL's default log file path from /var/log/pihole/pihole-FTL.log to the slightly shorter /var/log/pihole/FTL.log

@thomas-merz
Copy link

@yubiuser #4777 has been merged, but this issue isn't yet closed?! 🤷🏼‍♂️

@rdwebdesign
Copy link
Member

rdwebdesign commented Apr 3, 2024

4777 didn't solve the issue reported here.

  • 3732 changed the default directory and created the symlinks.
  • 4777 changed one file name (pihole-FTL.log to FTL.log).

The symlinks (and code to handle them) are still there.

Note:
v6 code:

# 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Confirmed Verified as a bug to be resolved
Projects
None yet
Development

No branches or pull requests

3 participants