mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
remove generated files and directories on package purge
This commit is contained in:
parent
a556a44707
commit
04fc649ebc
4 changed files with 164 additions and 0 deletions
41
debian/salt-common.postrm
vendored
Normal file
41
debian/salt-common.postrm
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Purge config files, logs, and directories created after package install.
|
||||
# Note that user-specified alternate locations for these are not affected.
|
||||
|
||||
clean_common() {
|
||||
# remove shared job cache and other runtime directories
|
||||
rm -rf /var/cache/salt /var/run/salt /etc/salt /var/log/salt 2> /dev/null
|
||||
}
|
||||
|
||||
clean_conf() {
|
||||
# remove config and log file for master, minion, or syndic
|
||||
rm -f /etc/salt/$1 /var/log/salt/$1 2> /dev/null
|
||||
# XXX add more specific files to purge here XXX #
|
||||
}
|
||||
|
||||
purgefiles() {
|
||||
case "$pkg" in
|
||||
master|minion|syndic)
|
||||
clean_conf $pkg ;;
|
||||
common)
|
||||
clean_common ;;
|
||||
*)
|
||||
echo "$0 unknown package \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
;;
|
||||
purge)
|
||||
purgefiles ;;
|
||||
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
|
||||
;;
|
||||
*)
|
||||
echo "$0 unknown action \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
exit 0
|
41
debian/salt-master.postrm
vendored
Normal file
41
debian/salt-master.postrm
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Purge config files, logs, and directories created after package install.
|
||||
# Note that user-specified alternate locations for these are not affected.
|
||||
|
||||
clean_common() {
|
||||
# remove shared job cache and other runtime directories
|
||||
rm -rf /var/cache/salt /var/run/salt /etc/salt /var/log/salt 2> /dev/null
|
||||
}
|
||||
|
||||
clean_conf() {
|
||||
# remove config and log file for master, minion, or syndic
|
||||
rm -f /etc/salt/$1 /var/log/salt/$1 2> /dev/null
|
||||
# XXX add more specific files to purge here XXX #
|
||||
}
|
||||
|
||||
purgefiles() {
|
||||
case "$pkg" in
|
||||
master|minion|syndic)
|
||||
clean_conf $pkg ;;
|
||||
common)
|
||||
clean_common ;;
|
||||
*)
|
||||
echo "$0 unknown package \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
;;
|
||||
purge)
|
||||
purgefiles ;;
|
||||
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
|
||||
;;
|
||||
*)
|
||||
echo "$0 unknown action \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
exit 0
|
41
debian/salt-minion.postrm
vendored
Normal file
41
debian/salt-minion.postrm
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Purge config files, logs, and directories created after package install.
|
||||
# Note that user-specified alternate locations for these are not affected.
|
||||
|
||||
clean_common() {
|
||||
# remove shared job cache and other runtime directories
|
||||
rm -rf /var/cache/salt /var/run/salt /etc/salt /var/log/salt 2> /dev/null
|
||||
}
|
||||
|
||||
clean_conf() {
|
||||
# remove config and log file for master, minion, or syndic
|
||||
rm -f /etc/salt/$1 /var/log/salt/$1 2> /dev/null
|
||||
# XXX add more specific files to purge here XXX #
|
||||
}
|
||||
|
||||
purgefiles() {
|
||||
case "$pkg" in
|
||||
master|minion|syndic)
|
||||
clean_conf $pkg ;;
|
||||
common)
|
||||
clean_common ;;
|
||||
*)
|
||||
echo "$0 unknown package \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
;;
|
||||
purge)
|
||||
purgefiles ;;
|
||||
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
|
||||
;;
|
||||
*)
|
||||
echo "$0 unknown action \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
exit 0
|
41
debian/salt-syndic.postrm
vendored
Normal file
41
debian/salt-syndic.postrm
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Purge config files, logs, and directories created after package install.
|
||||
# Note that user-specified alternate locations for these are not affected.
|
||||
|
||||
clean_common() {
|
||||
# remove shared job cache and other runtime directories
|
||||
rm -rf /var/cache/salt /var/run/salt /etc/salt /var/log/salt 2> /dev/null
|
||||
}
|
||||
|
||||
clean_conf() {
|
||||
# remove config and log file for master, minion, or syndic
|
||||
rm -f /etc/salt/$1 /var/log/salt/$1 2> /dev/null
|
||||
# XXX add more specific files to purge here XXX #
|
||||
}
|
||||
|
||||
purgefiles() {
|
||||
case "$pkg" in
|
||||
master|minion|syndic)
|
||||
clean_conf $pkg ;;
|
||||
common)
|
||||
clean_common ;;
|
||||
*)
|
||||
echo "$0 unknown package \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
;;
|
||||
purge)
|
||||
purgefiles ;;
|
||||
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
|
||||
;;
|
||||
*)
|
||||
echo "$0 unknown action \`$1'" 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue