mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
27 lines
898 B
Bash
27 lines
898 B
Bash
#!/bin/sh
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
case "$1" in
|
|
upgrade)
|
|
[ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt
|
|
[ -z "$SALT_USER" ] && SALT_USER=salt
|
|
[ -z "$SALT_NAME" ] && SALT_NAME="Salt"
|
|
[ -z "$SALT_GROUP" ] && SALT_GROUP=salt
|
|
|
|
# Reset permissions to fix previous installs
|
|
CUR_USER=$(ls -dl /run/salt-syndic.pid | cut -d ' ' -f 3)
|
|
CUR_GROUP=$(ls -dl /run/salt-syndic.pid | cut -d ' ' -f 4)
|
|
db_set salt-syndic/user $CUR_USER
|
|
chown -R $CUR_USER:$CUR_GROUP /var/log/salt/syndic
|
|
if command -v systemctl; then
|
|
SM_ENABLED=$(systemctl show -p UnitFileState salt-syndic | cut -d '=' -f 2)
|
|
db_set salt-syndic/enabled $SM_ENABLED
|
|
SM_ACTIVE=$(systemctl is-active salt-syndic)
|
|
db_set salt-syndic/active $SM_ACTIVE
|
|
else
|
|
db_set salt-syndic/enabled enabled
|
|
db_set salt-syndic/active active
|
|
fi
|
|
;;
|
|
esac
|