Skip to content

Commit dd91b48

Browse files
committed
Merge branch 'fix/logrotate' and resolve merge conflicts
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2 parents c8ef3c8 + 14b661a commit dd91b48

4 files changed

Lines changed: 2 additions & 14 deletions

File tree

src/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ RUN cd /etc/.pihole && \
7575
install -Dm755 -t /opt/pihole ./advanced/Scripts/*.sh && \
7676
install -Dm755 -t /opt/pihole ./advanced/Scripts/COL_TABLE && \
7777
install -Dm755 -d /etc/pihole && \
78-
install -Dm644 -t /etc/pihole ./advanced/Templates/logrotate && \
7978
install -Dm755 -d /var/log/pihole && \
8079
install -Dm755 -d /var/lib/logrotate && \
8180
install -Dm755 -t /usr/local/bin pihole && \
8281
install -Dm644 ./advanced/bash-completion/pihole.bash /etc/bash_completion.d/pihole && \
8382
install -Dm644 ./advanced/bash-completion/pihole-ftl.bash /etc/bash_completion.d/pihole-FTL && \
8483
install -T -m 0755 ./advanced/Templates/pihole-FTL-prestart.sh /opt/pihole/pihole-FTL-prestart.sh && \
8584
install -T -m 0755 ./advanced/Templates/pihole-FTL-poststop.sh /opt/pihole/pihole-FTL-poststop.sh && \
85+
install -T -m 644 ./advanced/Templates/logrotate /etc/logrotate.d/pihole && \
8686
addgroup -S pihole -g ${PIHOLE_GID} && adduser -S pihole -G pihole -u ${PIHOLE_UID}
8787

8888
COPY --chmod=0755 bash_functions.sh /usr/bin/bash_functions.sh

src/bash_functions.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ start_cron() {
9595
echo ""
9696
}
9797

98-
install_logrotate() {
99-
# Install the logrotate config file - this is done already in Dockerfile
100-
# but if a user has mounted a volume over /etc/pihole, it will have been lost
101-
# pihole-FTL-prestart.sh will set the ownership of the file to root:root
102-
echo " [i] Ensuring logrotate script exists in /etc/pihole"
103-
install -Dm644 -t /etc/pihole /etc/.pihole/advanced/Templates/logrotate
104-
echo ""
105-
}
106-
10798
migrate_gravity() {
10899
echo " [i] Gravity migration checks"
109100
gravityDBfile=$(getFTLConfigValue files.gravity)

src/start.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ start() {
4545
# Start crond for scheduled scripts (logrotate, pihole flush, gravity update etc)
4646
start_cron
4747

48-
# Install the logrotate config file
49-
install_logrotate
50-
5148
#migrate Gravity Database if needed:
5249
migrate_gravity
5350

test/test_default.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ teardown_file() {
5555
}
5656

5757
@test "Logrotate config is installed" {
58-
run docker exec "$CONTAINER" test -f /etc/pihole/logrotate
58+
run docker exec "$CONTAINER" test -f /etc/logrotate.d/pihole
5959
assert_success
6060
}
6161

0 commit comments

Comments
 (0)