From c35dfae7c5d01af23659fdd94f63254e50a037ef Mon Sep 17 00:00:00 2001 From: Rob Nagler <5495179+robnagler@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:15:30 -0700 Subject: [PATCH] Fix #525 timer_unit_service.jinja remove install target (#526) --- .../systemd/timer_unit_service.jinja | 3 - .../1.out/srv/host/v3.radia.run/db_bkp.sh | 2 +- .../etc/systemd/system/db_bkp.service | 3 - .../etc/systemd/system/logrotate.service | 3 - .../1.out/srv/host/v3.radia.run/logrotate.sh | 2 +- .../1.out/srv/host/v4.radia.run/db_bkp.sh | 13 ---- .../etc/systemd/system/db_bkp.service | 13 ---- .../etc/systemd/system/logrotate.service | 13 ---- .../1.out/srv/host/v4.radia.run/logrotate.sh | 60 ------------------- .../1.out/srv/host/v4.radia.run/script.sh | 2 +- .../1.out/srv/host/v5.radia.run/db_bkp.sh | 13 ---- .../etc/systemd/system/db_bkp.service | 13 ---- .../etc/systemd/system/logrotate.service | 13 ---- .../1.out/srv/host/v5.radia.run/logrotate.sh | 60 ------------------- .../1.out/srv/host/v6.radia.run/db_bkp.sh | 13 ---- .../etc/systemd/system/db_bkp.service | 13 ---- .../etc/systemd/system/logrotate.service | 13 ---- .../1.out/srv/host/v6.radia.run/logrotate.sh | 60 ------------------- .../1.out/srv/host/v9.radia.run/bkp.sh | 14 ----- .../1.out/srv/host/v9.radia.run/btest.sh | 2 +- .../1.out/srv/host/v9.radia.run/db_bkp.sh | 13 ---- .../etc/systemd/system/bkp.service | 13 ---- .../etc/systemd/system/btest.service | 3 - .../etc/systemd/system/db_bkp.service | 13 ---- .../etc/systemd/system/logrotate.service | 13 ---- .../1.out/srv/host/v9.radia.run/logrotate.sh | 60 ------------------- 26 files changed, 4 insertions(+), 439 deletions(-) delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/db_bkp.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/db_bkp.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/logrotate.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/logrotate.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/db_bkp.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/db_bkp.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/logrotate.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/logrotate.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/db_bkp.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/db_bkp.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/logrotate.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/logrotate.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/bkp.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/db_bkp.sh delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/bkp.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/db_bkp.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/logrotate.service delete mode 100644 tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/logrotate.sh diff --git a/rsconf/package_data/systemd/timer_unit_service.jinja b/rsconf/package_data/systemd/timer_unit_service.jinja index d5669336..992b4198 100644 --- a/rsconf/package_data/systemd/timer_unit_service.jinja +++ b/rsconf/package_data/systemd/timer_unit_service.jinja @@ -9,6 +9,3 @@ Group={{ systemd.run_u }} SyslogIdentifier={{ systemd.service_name }} Type=oneshot User={{ systemd.run_u }} - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/db_bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/db_bkp.sh index 96d69a09..e1d96653 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/db_bkp.sh +++ b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/db_bkp.sh @@ -7,7 +7,7 @@ rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/db_bkp/start' 'ede6d1b77f171c00358e47296b67c19f' rsconf_install_access '444' 'root' 'root' rsconf_install_file '/etc/systemd/system/db_bkp.timer' '64cdcbfab454f653ae9eb19bb0e138a3' -rsconf_install_file '/etc/systemd/system/db_bkp.service' 'e122d3a763a4419ecd7449f4be5f2b0d' +rsconf_install_file '/etc/systemd/system/db_bkp.service' '3fae29a217fc19782485d59cb3d5a732' rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/db_bkp/run' '07b2df16d25e42b467105336f512f8f0' } diff --git a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/db_bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/db_bkp.service index 9e387108..63eaa940 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/db_bkp.service +++ b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/db_bkp.service @@ -8,6 +8,3 @@ Group=root SyslogIdentifier=db_bkp Type=oneshot User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/logrotate.service b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/logrotate.service index 930ca44b..1ae2dda1 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/logrotate.service +++ b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/etc/systemd/system/logrotate.service @@ -8,6 +8,3 @@ Group=root SyslogIdentifier=logrotate Type=oneshot User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/logrotate.sh b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/logrotate.sh index 4995f1c0..29c2bbb1 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/logrotate.sh +++ b/tests/pkcli/build1_data/1.out/srv/host/v3.radia.run/logrotate.sh @@ -7,7 +7,7 @@ rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/logrotate/start' '0ee6bd9140a1e789bbac953e68a99916' rsconf_install_access '444' 'root' 'root' rsconf_install_file '/etc/systemd/system/logrotate.timer' '499f2dcff1b136d8943d48492ec1343d' -rsconf_install_file '/etc/systemd/system/logrotate.service' '17619e00593404a417203090aa6721ee' +rsconf_install_file '/etc/systemd/system/logrotate.service' '56956d00b58efac0eb2443c33c7ddcdf' rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/logrotate/run' 'f206f926ebf120cf6cdc65455dd16bef' rsconf_install_access '400' 'root' 'root' diff --git a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/db_bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/db_bkp.sh deleted file mode 100644 index 96d69a09..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/db_bkp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -db_bkp_rsconf_component() { -rsconf_service_prepare 'db_bkp.timer' '/etc/systemd/system/db_bkp.service' '/etc/systemd/system/db_bkp.timer' '/srv/db_bkp' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/db_bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/start' 'ede6d1b77f171c00358e47296b67c19f' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/db_bkp.timer' '64cdcbfab454f653ae9eb19bb0e138a3' -rsconf_install_file '/etc/systemd/system/db_bkp.service' 'e122d3a763a4419ecd7449f4be5f2b0d' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/run' '07b2df16d25e42b467105336f512f8f0' -} diff --git a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/db_bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/db_bkp.service deleted file mode 100644 index 9e387108..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/db_bkp.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=db_bkp - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/db_bkp/start -Group=root -SyslogIdentifier=db_bkp -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/logrotate.service b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/logrotate.service deleted file mode 100644 index 930ca44b..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/etc/systemd/system/logrotate.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=logrotate - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/logrotate/start -Group=root -SyslogIdentifier=logrotate -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/logrotate.sh b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/logrotate.sh deleted file mode 100644 index 4995f1c0..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/logrotate.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -logrotate_rsconf_component() { -rsconf_service_prepare 'logrotate.timer' '/etc/systemd/system/logrotate.service' '/etc/systemd/system/logrotate.timer' '/srv/logrotate' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/logrotate' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/start' '0ee6bd9140a1e789bbac953e68a99916' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/logrotate.timer' '499f2dcff1b136d8943d48492ec1343d' -rsconf_install_file '/etc/systemd/system/logrotate.service' '17619e00593404a417203090aa6721ee' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/run' 'f206f926ebf120cf6cdc65455dd16bef' -rsconf_install_access '400' 'root' 'root' -rsconf_install_file '/etc/logrotate.conf' 'c59f3376adf6ef244541b8ae596cc304' -logrotate_main -} -#!/bin/bash - -logrotate_main() { - # We use a systemd timer so can have output in the journal, and not emailed (anacron requires email) - rm -f /etc/cron.daily/logrotate - # We have our own run directory - if [[ ! -L /var/lib/logrotate ]]; then - rm -rf /var/lib/logrotate - ln -r -s '/srv/logrotate' /var/lib/logrotate - fi - # These don't have sensible defaults. See our logrotate.conf.jinja - rm -f /etc/logrotate.d/{bootlog,yum} - if [[ -e /etc/logrotate.d/nginx ]]; then - # This retention policy should be global - rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \ - 's/\brotate/#rotate/' - fi - # Must exist for logrotate.conf.jinja to export and rotate the journal - if [[ ! -e /var/log/journal.export ]]; then - install -m 600 -o root -g root /dev/null /var/log/journal.export - fi - # Fix up audit.log.1,2,etc. - local i f x - local b=/var/log/audit/audit.log - for i in 1 2 3 4; do - f=$b.$i - if [[ -r $f ]]; then - x=$b-$(date +%Y%m%d -r "$f").xz - xz -c < "$f" > "$x" - touch -r "$f" "$x" - rm -f "$f" - fi - done - # Files with gz or not compressed, need to be xz compressed - x='*-201[789][01][0-9][0-3][0-9]' - for f in $(find /var/log -name "$x.gz" -o -name "$x"); do - if [[ $f =~ gz$ ]]; then - gunzip "$f" - f=${f%.gz} - fi - xz "$f" - done -} - diff --git a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/script.sh b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/script.sh index 643f9731..16e441ed 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/script.sh +++ b/tests/pkcli/build1_data/1.out/srv/host/v4.radia.run/script.sh @@ -9,7 +9,7 @@ rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/every_five/start' '4ec245b018ccd9d3439958d81bf70acf' rsconf_install_access '444' 'root' 'root' rsconf_install_file '/etc/systemd/system/every_five.timer' 'd9cf11885ef351c6de1459426f91c654' -rsconf_install_file '/etc/systemd/system/every_five.service' '8ba4919aed381df75e79c8780bb1acf6' +rsconf_install_file '/etc/systemd/system/every_five.service' 'd828ea2c353bf449212fae83a9d90400' rsconf_install_access '500' 'root' 'root' rsconf_install_file '/srv/every_five/run' '15bb1f8cf012034cd494dd3e96d8bc76' } diff --git a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/db_bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/db_bkp.sh deleted file mode 100644 index 96d69a09..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/db_bkp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -db_bkp_rsconf_component() { -rsconf_service_prepare 'db_bkp.timer' '/etc/systemd/system/db_bkp.service' '/etc/systemd/system/db_bkp.timer' '/srv/db_bkp' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/db_bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/start' 'ede6d1b77f171c00358e47296b67c19f' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/db_bkp.timer' '64cdcbfab454f653ae9eb19bb0e138a3' -rsconf_install_file '/etc/systemd/system/db_bkp.service' 'e122d3a763a4419ecd7449f4be5f2b0d' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/run' '07b2df16d25e42b467105336f512f8f0' -} diff --git a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/db_bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/db_bkp.service deleted file mode 100644 index 9e387108..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/db_bkp.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=db_bkp - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/db_bkp/start -Group=root -SyslogIdentifier=db_bkp -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/logrotate.service b/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/logrotate.service deleted file mode 100644 index 930ca44b..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/etc/systemd/system/logrotate.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=logrotate - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/logrotate/start -Group=root -SyslogIdentifier=logrotate -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/logrotate.sh b/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/logrotate.sh deleted file mode 100644 index 4995f1c0..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v5.radia.run/logrotate.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -logrotate_rsconf_component() { -rsconf_service_prepare 'logrotate.timer' '/etc/systemd/system/logrotate.service' '/etc/systemd/system/logrotate.timer' '/srv/logrotate' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/logrotate' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/start' '0ee6bd9140a1e789bbac953e68a99916' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/logrotate.timer' '499f2dcff1b136d8943d48492ec1343d' -rsconf_install_file '/etc/systemd/system/logrotate.service' '17619e00593404a417203090aa6721ee' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/run' 'f206f926ebf120cf6cdc65455dd16bef' -rsconf_install_access '400' 'root' 'root' -rsconf_install_file '/etc/logrotate.conf' 'c59f3376adf6ef244541b8ae596cc304' -logrotate_main -} -#!/bin/bash - -logrotate_main() { - # We use a systemd timer so can have output in the journal, and not emailed (anacron requires email) - rm -f /etc/cron.daily/logrotate - # We have our own run directory - if [[ ! -L /var/lib/logrotate ]]; then - rm -rf /var/lib/logrotate - ln -r -s '/srv/logrotate' /var/lib/logrotate - fi - # These don't have sensible defaults. See our logrotate.conf.jinja - rm -f /etc/logrotate.d/{bootlog,yum} - if [[ -e /etc/logrotate.d/nginx ]]; then - # This retention policy should be global - rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \ - 's/\brotate/#rotate/' - fi - # Must exist for logrotate.conf.jinja to export and rotate the journal - if [[ ! -e /var/log/journal.export ]]; then - install -m 600 -o root -g root /dev/null /var/log/journal.export - fi - # Fix up audit.log.1,2,etc. - local i f x - local b=/var/log/audit/audit.log - for i in 1 2 3 4; do - f=$b.$i - if [[ -r $f ]]; then - x=$b-$(date +%Y%m%d -r "$f").xz - xz -c < "$f" > "$x" - touch -r "$f" "$x" - rm -f "$f" - fi - done - # Files with gz or not compressed, need to be xz compressed - x='*-201[789][01][0-9][0-3][0-9]' - for f in $(find /var/log -name "$x.gz" -o -name "$x"); do - if [[ $f =~ gz$ ]]; then - gunzip "$f" - f=${f%.gz} - fi - xz "$f" - done -} - diff --git a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/db_bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/db_bkp.sh deleted file mode 100644 index 96d69a09..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/db_bkp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -db_bkp_rsconf_component() { -rsconf_service_prepare 'db_bkp.timer' '/etc/systemd/system/db_bkp.service' '/etc/systemd/system/db_bkp.timer' '/srv/db_bkp' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/db_bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/start' 'ede6d1b77f171c00358e47296b67c19f' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/db_bkp.timer' '64cdcbfab454f653ae9eb19bb0e138a3' -rsconf_install_file '/etc/systemd/system/db_bkp.service' 'e122d3a763a4419ecd7449f4be5f2b0d' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/run' '07b2df16d25e42b467105336f512f8f0' -} diff --git a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/db_bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/db_bkp.service deleted file mode 100644 index 9e387108..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/db_bkp.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=db_bkp - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/db_bkp/start -Group=root -SyslogIdentifier=db_bkp -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/logrotate.service b/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/logrotate.service deleted file mode 100644 index 930ca44b..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/etc/systemd/system/logrotate.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=logrotate - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/logrotate/start -Group=root -SyslogIdentifier=logrotate -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/logrotate.sh b/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/logrotate.sh deleted file mode 100644 index 4995f1c0..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v6.radia.run/logrotate.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -logrotate_rsconf_component() { -rsconf_service_prepare 'logrotate.timer' '/etc/systemd/system/logrotate.service' '/etc/systemd/system/logrotate.timer' '/srv/logrotate' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/logrotate' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/start' '0ee6bd9140a1e789bbac953e68a99916' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/logrotate.timer' '499f2dcff1b136d8943d48492ec1343d' -rsconf_install_file '/etc/systemd/system/logrotate.service' '17619e00593404a417203090aa6721ee' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/run' 'f206f926ebf120cf6cdc65455dd16bef' -rsconf_install_access '400' 'root' 'root' -rsconf_install_file '/etc/logrotate.conf' 'c59f3376adf6ef244541b8ae596cc304' -logrotate_main -} -#!/bin/bash - -logrotate_main() { - # We use a systemd timer so can have output in the journal, and not emailed (anacron requires email) - rm -f /etc/cron.daily/logrotate - # We have our own run directory - if [[ ! -L /var/lib/logrotate ]]; then - rm -rf /var/lib/logrotate - ln -r -s '/srv/logrotate' /var/lib/logrotate - fi - # These don't have sensible defaults. See our logrotate.conf.jinja - rm -f /etc/logrotate.d/{bootlog,yum} - if [[ -e /etc/logrotate.d/nginx ]]; then - # This retention policy should be global - rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \ - 's/\brotate/#rotate/' - fi - # Must exist for logrotate.conf.jinja to export and rotate the journal - if [[ ! -e /var/log/journal.export ]]; then - install -m 600 -o root -g root /dev/null /var/log/journal.export - fi - # Fix up audit.log.1,2,etc. - local i f x - local b=/var/log/audit/audit.log - for i in 1 2 3 4; do - f=$b.$i - if [[ -r $f ]]; then - x=$b-$(date +%Y%m%d -r "$f").xz - xz -c < "$f" > "$x" - touch -r "$f" "$x" - rm -f "$f" - fi - done - # Files with gz or not compressed, need to be xz compressed - x='*-201[789][01][0-9][0-3][0-9]' - for f in $(find /var/log -name "$x.gz" -o -name "$x"); do - if [[ $f =~ gz$ ]]; then - gunzip "$f" - f=${f%.gz} - fi - xz "$f" - done -} - diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/bkp.sh deleted file mode 100644 index aebe8509..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/bkp.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -bkp_rsconf_component() { -rsconf_service_prepare 'bkp.timer' '/etc/systemd/system/bkp.service' '/etc/systemd/system/bkp.timer' '/srv/bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/bkp/secondary' 'f91c10fc0fdfe67360067343a2577c1b' -rsconf_install_file '/srv/bkp/secondary_setup' '84b40460f8374ccbde4c353cc301f5fc' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/bkp/start' '845d92f865b14e8d26fb7259608f78ba' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/bkp.timer' '97d463b79906d1e9b794937d3a9c4993' -rsconf_install_file '/etc/systemd/system/bkp.service' '443c9c34df3eddec3268f081e7dead77' -} diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/btest.sh b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/btest.sh index b0b8ee96..e6d56b3b 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/btest.sh +++ b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/btest.sh @@ -7,7 +7,7 @@ rsconf_install_access '500' 'vagrant' 'vagrant' rsconf_install_file '/srv/btest/start' '8cf5c4757183681faf4f33629f8fc206' rsconf_install_access '444' 'root' 'root' rsconf_install_file '/etc/systemd/system/btest.timer' 'db74bbfe017f3485a2f99dc8dc8a588b' -rsconf_install_file '/etc/systemd/system/btest.service' 'dd8afd0cf89b9a67be87ebf629c29c23' +rsconf_install_file '/etc/systemd/system/btest.service' 'b817e96955920937e11b567bd54e64ca' rsconf_install_access '700' 'vagrant' 'vagrant' rsconf_install_directory '/srv/btest/apps' rsconf_install_directory '/home/vagrant/btest-mail' diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/db_bkp.sh b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/db_bkp.sh deleted file mode 100644 index 96d69a09..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/db_bkp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -db_bkp_rsconf_component() { -rsconf_service_prepare 'db_bkp.timer' '/etc/systemd/system/db_bkp.service' '/etc/systemd/system/db_bkp.timer' '/srv/db_bkp' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/db_bkp' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/start' 'ede6d1b77f171c00358e47296b67c19f' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/db_bkp.timer' '64cdcbfab454f653ae9eb19bb0e138a3' -rsconf_install_file '/etc/systemd/system/db_bkp.service' 'e122d3a763a4419ecd7449f4be5f2b0d' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/db_bkp/run' '07b2df16d25e42b467105336f512f8f0' -} diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/bkp.service deleted file mode 100644 index f61e0693..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/bkp.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=bkp - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/bkp/start -Group=root -SyslogIdentifier=bkp -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/btest.service b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/btest.service index ca78763b..0ee6d866 100644 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/btest.service +++ b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/btest.service @@ -8,6 +8,3 @@ Group=vagrant SyslogIdentifier=btest Type=oneshot User=vagrant - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/db_bkp.service b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/db_bkp.service deleted file mode 100644 index 9e387108..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/db_bkp.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=db_bkp - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/db_bkp/start -Group=root -SyslogIdentifier=db_bkp -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/logrotate.service b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/logrotate.service deleted file mode 100644 index 930ca44b..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/etc/systemd/system/logrotate.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=logrotate - -[Service] -Environment=TZ=:/etc/localtime -ExecStart=/srv/logrotate/start -Group=root -SyslogIdentifier=logrotate -Type=oneshot -User=root - -[Install] -WantedBy=multi-user.target diff --git a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/logrotate.sh b/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/logrotate.sh deleted file mode 100644 index 4995f1c0..00000000 --- a/tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/logrotate.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -logrotate_rsconf_component() { -rsconf_service_prepare 'logrotate.timer' '/etc/systemd/system/logrotate.service' '/etc/systemd/system/logrotate.timer' '/srv/logrotate' -rsconf_install_access '700' 'root' 'root' -rsconf_install_directory '/srv/logrotate' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/start' '0ee6bd9140a1e789bbac953e68a99916' -rsconf_install_access '444' 'root' 'root' -rsconf_install_file '/etc/systemd/system/logrotate.timer' '499f2dcff1b136d8943d48492ec1343d' -rsconf_install_file '/etc/systemd/system/logrotate.service' '17619e00593404a417203090aa6721ee' -rsconf_install_access '500' 'root' 'root' -rsconf_install_file '/srv/logrotate/run' 'f206f926ebf120cf6cdc65455dd16bef' -rsconf_install_access '400' 'root' 'root' -rsconf_install_file '/etc/logrotate.conf' 'c59f3376adf6ef244541b8ae596cc304' -logrotate_main -} -#!/bin/bash - -logrotate_main() { - # We use a systemd timer so can have output in the journal, and not emailed (anacron requires email) - rm -f /etc/cron.daily/logrotate - # We have our own run directory - if [[ ! -L /var/lib/logrotate ]]; then - rm -rf /var/lib/logrotate - ln -r -s '/srv/logrotate' /var/lib/logrotate - fi - # These don't have sensible defaults. See our logrotate.conf.jinja - rm -f /etc/logrotate.d/{bootlog,yum} - if [[ -e /etc/logrotate.d/nginx ]]; then - # This retention policy should be global - rsconf_edit_no_change_res=0 rsconf_edit /etc/logrotate.d/nginx '#rotate' \ - 's/\brotate/#rotate/' - fi - # Must exist for logrotate.conf.jinja to export and rotate the journal - if [[ ! -e /var/log/journal.export ]]; then - install -m 600 -o root -g root /dev/null /var/log/journal.export - fi - # Fix up audit.log.1,2,etc. - local i f x - local b=/var/log/audit/audit.log - for i in 1 2 3 4; do - f=$b.$i - if [[ -r $f ]]; then - x=$b-$(date +%Y%m%d -r "$f").xz - xz -c < "$f" > "$x" - touch -r "$f" "$x" - rm -f "$f" - fi - done - # Files with gz or not compressed, need to be xz compressed - x='*-201[789][01][0-9][0-3][0-9]' - for f in $(find /var/log -name "$x.gz" -o -name "$x"); do - if [[ $f =~ gz$ ]]; then - gunzip "$f" - f=${f%.gz} - fi - xz "$f" - done -} -