diff --git a/CHANGELOG b/CHANGELOG index 3e88d4c..8116d59 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [COMMON] Use new mongodb `connect` command to interact with all versions of DB - [UPGRADE-PKG] Restart GUI/Portal services only at the end of an upgrade ### Fixed -- [UPGRADE-PKG] Only restart jail service(s) when corresponding package is upgraded +- [UPGRADE-PKG] Stop GUI services for the entire duration of the upgrade - [UPGRADE-OS] Do not check version when specifying a version to install diff --git a/usr/local/share/vulture-utils/upgrade-pkg.sh b/usr/local/share/vulture-utils/upgrade-pkg.sh index e5f5e9e..e186f78 100755 --- a/usr/local/share/vulture-utils/upgrade-pkg.sh +++ b/usr/local/share/vulture-utils/upgrade-pkg.sh @@ -54,6 +54,13 @@ initialize() { /usr/sbin/service vultured stop fi + if /usr/sbin/jexec apache /usr/sbin/service gunicorn status > /dev/null; then + echo "[+] Stopping GUI services..." + _gui_was_up=1 + /usr/sbin/jexec apache /usr/sbin/service gunicorn stop + echo "[-] Ok." + fi + # Disable secadm rules if on an HardenedBSD system if [ -f /usr/sbin/hbsd-update ] ; then echo "[+] Disabling root secadm rules" @@ -158,20 +165,23 @@ finalize() { echo "[-] Cron restarted" fi - /usr/local/bin/sudo -u vlt-os /home/vlt-os/env/bin/python /home/vlt-os/vulture_os/manage.py toggle_maintenance --off 2>/dev/null || true - if [ $_vultured_was_up -eq 1 ]; then echo "[+] Restarting vultured..." /usr/sbin/service vultured start + echo "[-] Vultured restarted successfully" fi if [ $_gui_was_up -eq 1 ]; then echo "[+] Restarting GUI services..." /usr/sbin/jexec apache /usr/sbin/service gunicorn start + echo "[-] GUI restarted successfully" fi if [ $_portal_was_up -eq 1 ]; then echo "[+] Restarting Portal services..." /usr/sbin/jexec portal /usr/sbin/service gunicorn start + echo "[-] Portal restarted successfully" fi + + /usr/local/bin/sudo -u vlt-os /home/vlt-os/env/bin/python /home/vlt-os/vulture_os/manage.py toggle_maintenance --off 2>/dev/null || true fi echo "[$(date -Iseconds)] Upgrade finished!" @@ -310,9 +320,9 @@ if [ -z "${targets}" ] || contains_word "${targets}" "gui" ; then echo "[+] Stopping GUI services..." _gui_was_up=1 /usr/sbin/jexec apache /usr/sbin/service gunicorn stop - echo "[-] Ok." + echo "[-] GUI has been stopped" else - warn "GUI is currently stopped, the service won't be restarted!" + echo "[*] GUI is already stopped" fi if /usr/sbin/jexec portal /usr/sbin/service gunicorn status > /dev/null; then echo "[+] Stopping Portal services..." @@ -320,7 +330,7 @@ if [ -z "${targets}" ] || contains_word "${targets}" "gui" ; then /usr/sbin/jexec portal /usr/sbin/service gunicorn stop echo "[-] Ok." else - warn "Portal is currently stopped, the service won't be restarted!" + echo "[*] Portal is already stopped" fi echo "[+] Updating vulture-gui package..."