mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Wait for zypper processes to finish before calling zypper again
Fixes an issue where the bootstrap script bails out if there is a zypper process running already on the machine to be bootstrapped. This can happen when a machine has been modified to use zypper in a boot command. We need to wait for the process to finish before calling the next zypper command. Otherwise, the following error occurs: ``` System management is locked by the application with pid <pid#> (zypper). ```
This commit is contained in:
parent
17dc74ba13
commit
9fb764dcb2
1 changed files with 7 additions and 0 deletions
|
@ -5456,6 +5456,13 @@ __version_lte() {
|
|||
}
|
||||
|
||||
__zypper() {
|
||||
# Check if any zypper process is running before calling zypper again.
|
||||
# This is useful when a zypper call is part of a boot process and will
|
||||
# wait until the zypper process is finished, such as on AWS AMIs.
|
||||
while pgrep -l zypper; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
zypper --non-interactive "${@}"; return $?
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue