diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eecbfafa66..422b322dbb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -79,7 +79,7 @@ Added to pants' use of PEX lockfiles. This is not a user-facing addition. #6118 #6141 #6133 #6120 #6181 #6183 #6200 #6237 #6229 #6240 #6241 #6244 #6251 #6253 #6254 #6258 #6259 #6260 #6269 #6275 #6279 #6278 #6282 #6283 #6273 #6287 #6306 #6307 - #6311 #6314 + #6311 #6314 #6315 Contributed by @cognifloyd * Build of ST2 EL9 packages #6153 Contributed by @amanda11 diff --git a/packaging/deb/scripts/post-install.sh b/packaging/deb/scripts/post-install.sh index fd9007cd8a..225ec93d4f 100644 --- a/packaging/deb/scripts/post-install.sh +++ b/packaging/deb/scripts/post-install.sh @@ -6,16 +6,28 @@ set -e # summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# configure +# on fresh install +# configure +# on upgrade OR on install after pkg removal without purging conf files +# abort-upgrade +# on upgrade failed (after failure of prerm, preinst, postrm) +# abort-remove in-favour +# on removal due to conflict with other package +# abort-remove +# on removal (after failure of prerm) +# abort-deconfigure in-favour +# +# [ removing ] +# on removal due to breaks/conflict with other package (if --auto-deconfigure) +# triggered [ ...] +# when a trigger we've registered interest in fires, +# such as when /usr/bin/python3.9 (or similar) gets updated, +# allowing this script to rebuild the venv. +# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html +# https://www.mankier.com/5/deb-postinst +# https://www.mankier.com/5/deb-triggers +# https://stackoverflow.com/questions/15276535/dpkg-how-to-use-trigger case "$1" in configure) diff --git a/packaging/deb/scripts/post-remove.sh b/packaging/deb/scripts/post-remove.sh index 9cfe930fb7..bdc758ad74 100644 --- a/packaging/deb/scripts/post-remove.sh +++ b/packaging/deb/scripts/post-remove.sh @@ -6,17 +6,23 @@ set -e # summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# remove +# on remove or remove+purge +# purge +# on purge or remove+purge +# upgrade +# on upgrade +# disappear +# on implicit removal (all package files replaced by another package) +# abort-install +# on failed fresh install (after failed) +# abort-install +# on failed install after pkg removal w/o conf purge (and failed) +# failed-upgrade +# on upgrade failed (after failed) +# abort-upgrade +# on upgrade failed (after or failed) +# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html purge_files() { # This -pkgsaved.disabled file might be left over from old (buggy) deb packages diff --git a/packaging/deb/scripts/pre-install.sh b/packaging/deb/scripts/pre-install.sh index 5d327b21ae..9e5f935c8e 100644 --- a/packaging/deb/scripts/pre-install.sh +++ b/packaging/deb/scripts/pre-install.sh @@ -6,12 +6,15 @@ set -e # summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package +# install +# on fresh install +# install +# on install after pkg removal without conf purge +# upgrade +# on upgrade +# abort-upgrade +# on upgrade failed (after failure of postrm) +# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html PACKS_GROUP=st2packs SYS_USER=stanley diff --git a/packaging/deb/scripts/pre-remove.sh b/packaging/deb/scripts/pre-remove.sh new file mode 100644 index 0000000000..fc644fd39c --- /dev/null +++ b/packaging/deb/scripts/pre-remove.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# prerm script for st2 + +set -e + +# summary of how this script can be called: +# remove +# on remove or remove+purge +# upgrade +# on upgrade +# remove in-favour +# on removal due to conflict with other package +# deconfigure in-favour +# +# [ removing ] +# on removal due to breaks/conflict with other package (if --auto-deconfigure) +# failed-upgrade +# on upgrade failed (after failed) +# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html diff --git a/packaging/rpm/scripts/post-install.sh b/packaging/rpm/scripts/post-install.sh index 65f63cf599..362ff56b6d 100644 --- a/packaging/rpm/scripts/post-install.sh +++ b/packaging/rpm/scripts/post-install.sh @@ -1,4 +1,15 @@ set -e +# This %post scriptlet gets one argument, $1, the number of packages of +# this name that will be left on the system when this script completes. So: +# * on install: $1 = 1 +# * on upgrade: $1 > 1 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax + +# from %post in st2-packages.git/packages/st2/rpm/st2.spec +%service_post st2actionrunner st2api st2stream st2auth st2notifier st2workflowengine +%service_post st2rulesengine st2timersengine st2sensorcontainer st2garbagecollector +%service_post st2scheduler + # make sure that our socket generators run systemctl daemon-reload >/dev/null 2>&1 || true diff --git a/packaging/rpm/scripts/post-remove.sh b/packaging/rpm/scripts/post-remove.sh new file mode 100644 index 0000000000..f2cc17a977 --- /dev/null +++ b/packaging/rpm/scripts/post-remove.sh @@ -0,0 +1,17 @@ +set -e + +# This %postun scriptlet gets one argument, $1, the number of packages of +# this name that will be left on the system when this script completes. So: +# * on upgrade: $1 > 0 +# * on uninstall: $1 = 0 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax + +# from %postun in st2-packages.git/packages/st2/rpm/st2.spec +%service_postun st2actionrunner %{worker_name} st2api st2stream st2auth st2notifier st2workflowengine +%service_postun st2rulesengine st2timersengine st2sensorcontainer st2garbagecollector +%service_postun st2scheduler + +# Remove st2 logrotate config, since there's no analog of apt-get purge available +if [ $1 -eq 0 ]; then + rm -f /etc/logrotate.d/st2 +fi diff --git a/packaging/rpm/scripts/pre-install.sh b/packaging/rpm/scripts/pre-install.sh index 0b430e33a0..e12dd26590 100644 --- a/packaging/rpm/scripts/pre-install.sh +++ b/packaging/rpm/scripts/pre-install.sh @@ -1,5 +1,11 @@ set -e +# This %pre scriptlet gets one argument, $1, the number of packages of +# this name that will be left on the system when this script completes. So: +# * on install: $1 = 1 +# * on upgrade: $1 > 1 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax + PACKS_GROUP=%{packs_group} SYS_USER=%{stanley_user} ST2_USER=%{svc_user} diff --git a/packaging/rpm/scripts/pre-remove.sh b/packaging/rpm/scripts/pre-remove.sh new file mode 100644 index 0000000000..6f65230cca --- /dev/null +++ b/packaging/rpm/scripts/pre-remove.sh @@ -0,0 +1,12 @@ +set -e + +# This %preun scriptlet gets one argument, $1, the number of packages of +# this name that will be left on the system when this script completes. So: +# * on upgrade: $1 > 0 +# * on uninstall: $1 = 0 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax + +# from %preun in st2-packages.git/packages/st2/rpm/st2.spec +%service_preun st2actionrunner %{worker_name} st2api st2stream st2auth st2notifier st2workflowengine +%service_preun st2rulesengine st2timersengine st2sensorcontainer st2garbagecollector +%service_preun st2scheduler