Fix install of logrotate config for debian pkg

Fixes the install of logrotate config for the debian pkg
by moving file to pkg/common/logrotate/salt-common. File
is installed via salt-common.install file, which can't
rename files, only copy them to a directory, so we need to
rename the file and put it in a subdir of pkg/common.

Adds /etc/logrotate.d/salt-common to salt.common.conffiles to
ensure that dpkg will not overwrite configs modified by users.

Also updates RPM spec file for new location of logrotate config.

Config needs to be /etc/logrotate.d/salt-common as that is what
is used by 3005.x packages.
This commit is contained in:
Barney Sowood 2023-09-29 17:48:22 +01:00 committed by Pedro Algarvio
parent 4fd5072dbd
commit 1abcf81601
6 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1 @@
/etc/logrotate.d/salt-common

View file

@ -4,3 +4,4 @@
/usr/share/fish/vendor_completions.d
/opt/saltstack/salt
/etc/salt
/etc/logrotate.d

View file

@ -1,4 +1,4 @@
pkg/common/salt-common.logrotate /etc/logrotate.d/salt
pkg/common/logrotate/salt-common /etc/logrotate.d
pkg/common/fish-completions/salt-cp.fish /usr/share/fish/vendor_completions.d
pkg/common/fish-completions/salt-call.fish /usr/share/fish/vendor_completions.d
pkg/common/fish-completions/salt-syndic.fish /usr/share/fish/vendor_completions.d

View file

@ -31,5 +31,9 @@ case "$1" in
-s $SALT_SHELL \
-g $SALT_GROUP \
$SALT_USER
# Remove incorrectly installed logrotate config - issue 65231
test -d /etc/logrotate.d/salt && rm -r /etc/logrotate.d/salt || /bin/true
;;
esac

View file

@ -266,7 +266,7 @@ install -p -m 0644 %{_salt_src}/pkg/common/salt-proxy@.service %{buildroot}%{_un
# Logrotate
#install -p %{SOURCE10} .
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
install -p -m 0644 %{_salt_src}/pkg/common/salt-common.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/salt
install -p -m 0644 %{_salt_src}/pkg/common/logrotate/salt-common %{buildroot}%{_sysconfdir}/logrotate.d/salt
# Bash completion
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/