Skip to content

Commit

Permalink
UPGRADE_SCRIPTS::FIXED:: Don't restart secadm immediately after updat…
Browse files Browse the repository at this point in the history
…ing the kernel, restart vultured after everything else
  • Loading branch information
frikilax committed Oct 28, 2021
1 parent 90f261f commit 5fbcb2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
17 changes: 5 additions & 12 deletions home/vlt-adm/system/update_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ update_system() {
# If command failed, download the archive
if [ $? -ne 0 ] ; then /usr/sbin/hbsd-update -t "$temp_dir" -T $options ; fi
if [ $? -ne 0 ] ; then /usr/sbin/hbsd-update -d -t "$temp_dir" -T $options ; fi
# Restart secadm service after updating kernel
if [ -n "$jail" ] ; then
/usr/sbin/pkg -j $jail install -y secadm secadm-kmod
/usr/sbin/jexec $jail /usr/sbin/service secadm restart
else
/usr/sbin/service secadm restart
fi
else
# If jail, just install do not fetch
if [ -n "$jail" ] ; then options="-b /zroot/$jail" ; else option="fetch" ; fi
Expand Down Expand Up @@ -150,11 +143,6 @@ if [ -z "$1" ] ; then
# Then, upgrade all packages
IGNORE_OSVERSION="yes" /usr/sbin/pkg upgrade -y
echo "[+] All packages updated"
# Do not start vultured if the node is not installed
if [ -f /home/vlt-os/vulture_os/.node_ok ]; then
/usr/sbin/service vultured restart

fi
fi

# Re-enable secadm rules if on an HardenedBSD system
Expand All @@ -168,5 +156,10 @@ if [ -f /usr/sbin/hbsd-update ] ; then
done
fi

# Do not start vultured if the node is not installed
if [ -f /home/vlt-os/vulture_os/.node_ok ]; then
/usr/sbin/service vultured restart
fi

# Remove temporary folder for system updates
/bin/rm -rf $temp_dir
10 changes: 5 additions & 5 deletions home/vlt-adm/system/update_system_lite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ if [ -z "$1" ] ; then
# Then, upgrade all packages
IGNORE_OSVERSION="yes" /usr/sbin/pkg upgrade -y
echo "[+] All packages updated"
# Do not start vultured if the node is not installed
if [ -f /home/vlt-os/vulture_os/.node_ok ]; then
/usr/sbin/service vultured restart

fi
fi

# Re-enable secadm rules if on an HardenedBSD system
Expand All @@ -132,3 +127,8 @@ if [ -f /usr/sbin/hbsd-update ] ; then
/usr/sbin/jexec $jail /usr/sbin/service secadm start || echo "Could not enable secadm rules"
done
fi

# Do not start vultured if the node is not installed
if [ -f /home/vlt-os/vulture_os/.node_ok ]; then
/usr/sbin/service vultured restart
fi

0 comments on commit 5fbcb2b

Please sign in to comment.