mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #8913 from Security-Onion-Solutions/config
retry up to 25 minutes if APT is locked by an unattended upgrade. This is an increase from 8 minutes.
This commit is contained in:
@@ -946,17 +946,17 @@ installer_prereq_packages() {
|
||||
logCmd "systemctl start NetworkManager"
|
||||
elif [ "$OS" == ubuntu ]; then
|
||||
# Print message to stdout so the user knows setup is doing something
|
||||
retry 50 10 "apt-get update" "" "Err:" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 150 10 "apt-get update" "" "Err:" >> "$setup_log" 2>&1 || exit 1
|
||||
# Install network manager so we can do interface stuff
|
||||
if ! command -v nmcli > /dev/null 2>&1; then
|
||||
retry 50 10 "apt-get -y install network-manager" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 150 10 "apt-get -y install network-manager" >> "$setup_log" 2>&1 || exit 1
|
||||
{
|
||||
systemctl enable NetworkManager
|
||||
systemctl start NetworkManager
|
||||
} >> "$setup_log" 2<&1
|
||||
fi
|
||||
if ! command -v curl > /dev/null 2>&1; then
|
||||
retry 50 10 "apt-get -y install curl" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 150 10 "apt-get -y install curl" >> "$setup_log" 2>&1 || exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -1827,7 +1827,7 @@ remove_package() {
|
||||
fi
|
||||
else
|
||||
if dpkg -l | grep -q "$package_name"; then
|
||||
retry 50 10 "apt purge -y \"$package_name\""
|
||||
retry 150 10 "apt purge -y \"$package_name\""
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -2260,8 +2260,8 @@ update_packages() {
|
||||
logCmd "yum -y update --exclude=salt*,wazuh*,docker*,containerd*"
|
||||
logCmd "yum -y install yum-utils"
|
||||
else
|
||||
retry 50 10 "apt-get -y update" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 50 10 "apt-get -y upgrade" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 150 10 "apt-get -y update" >> "$setup_log" 2>&1 || exit 1
|
||||
retry 150 10 "apt-get -y upgrade" >> "$setup_log" 2>&1 || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ check_default_repos() {
|
||||
printf '%s' 'apt update.' | tee -a "$preflight_log"
|
||||
fi
|
||||
echo "" >> "$preflight_log"
|
||||
retry 50 10 "apt-get -y update" >> $preflight_log 2>&1
|
||||
retry 150 10 "apt-get -y update" >> $preflight_log 2>&1
|
||||
ret_code=$?
|
||||
[[ $ret_code == 0 ]] && printf '%s\n' ' SUCCESS' || printf '%s\n' ' FAILURE'
|
||||
|
||||
@@ -161,7 +161,7 @@ preflight_prereqs() {
|
||||
if [[ $OS == 'centos' ]]; then
|
||||
: # no-op to match structure of other checks for $OS var
|
||||
else
|
||||
retry 50 10 "apt-get -y install curl" >> "$preflight_log" 2>&1 || ret_code=1
|
||||
retry 150 10 "apt-get -y install curl" >> "$preflight_log" 2>&1 || ret_code=1
|
||||
fi
|
||||
|
||||
return $ret_code
|
||||
|
||||
Reference in New Issue
Block a user