Skip to content

Commit f2108f3

Browse files
authored
Fix #641 logrotate remove delaycompress (#642)
1 parent 482e3ec commit f2108f3

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

rsconf/package_data/logrotate/main.sh.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
shopt -s nullglob
23

34
logrotate_main() {
45
# We use a systemd timer so can have output in the journal, and not emailed (anacron requires email)
@@ -15,6 +16,12 @@ logrotate_main() {
1516
rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \
1617
's/\brotate/#rotate/'
1718
fi
19+
for f in /etc/logrotate.d/*; do
20+
if grep --no-messages --quiet ' delaycompress' "$f"; then
21+
rsconf_edit_no_change_res=0 rsconf_edit "$f" '#delaycompress' \
22+
's/\bdelaycompress/#delaycompress/'
23+
fi
24+
done
1825
# Must exist for logrotate.conf.jinja to export and rotate the journal
1926
if [[ ! -e /var/log/journal.export ]]; then
2027
install -m 600 -o root -g root /dev/null /var/log/journal.export

tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/logrotate.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rsconf_install_file '/etc/logrotate.conf' 'c59f3376adf6ef244541b8ae596cc304'
1515
logrotate_main
1616
}
1717
#!/bin/bash
18+
shopt -s nullglob
1819

1920
logrotate_main() {
2021
# We use a systemd timer so can have output in the journal, and not emailed (anacron requires email)
@@ -31,6 +32,12 @@ logrotate_main() {
3132
rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \
3233
's/\brotate/#rotate/'
3334
fi
35+
for f in /etc/logrotate.d/*; do
36+
if grep --no-messages --quiet ' delaycompress' "$f"; then
37+
rsconf_edit_no_change_res=0 rsconf_edit "$f" '#delaycompress' \
38+
's/\bdelaycompress/#delaycompress/'
39+
fi
40+
done
3441
# Must exist for logrotate.conf.jinja to export and rotate the journal
3542
if [[ ! -e /var/log/journal.export ]]; then
3643
install -m 600 -o root -g root /dev/null /var/log/journal.export

0 commit comments

Comments
 (0)