account for different paths for the systemd service files in later versions.

This commit is contained in:
Gareth J. Greenaway 2023-02-01 18:52:13 -08:00
parent 0280cde59a
commit 4eabf0aeb6
No known key found for this signature in database
GPG key ID: 10B62F8A7CAD7A41

View file

@ -4791,10 +4791,16 @@ install_centos_git_post() {
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
# Account for new path for services files in later releases
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service" ]; then
_SERVICE_FILE="${_SALT_GIT_CHECKOUT_DIR}/pkg/common/salt-${fname}.service"
else
_SERVICE_FILE="${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service"
fi
if [ -f /bin/systemctl ]; then
if [ ! -f "/usr/lib/systemd/system/salt-${fname}.service" ] || \
{ [ -f "/usr/lib/systemd/system/salt-${fname}.service" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" /usr/lib/systemd/system
__copyfile "${_SERVICE_FILE}" /usr/lib/systemd/system
fi
SYSTEMD_RELOAD=$BS_TRUE