Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
20 changes: 15 additions & 5 deletions usr/local/share/vulture-utils/upgrade-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Comment thread
frikilax marked this conversation as resolved.
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!"
Expand Down Expand Up @@ -310,17 +320,17 @@ 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..."
_portal_was_up=1
/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..."
Expand Down