mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Misc wording / log helper usage
This commit is contained in:
parent
a97d0bdc01
commit
7e893baef4
1 changed files with 3 additions and 4 deletions
|
@ -55,8 +55,7 @@ LXC_CREATE () {
|
||||||
# The first time around when we create the VM, if it fails, we want to abort early
|
# The first time around when we create the VM, if it fails, we want to abort early
|
||||||
# instead of keeping the timeout game until the end of times
|
# instead of keeping the timeout game until the end of times
|
||||||
if ! _LXC_START_AND_WAIT $LXC_NAME; then
|
if ! _LXC_START_AND_WAIT $LXC_NAME; then
|
||||||
log_error "Fatal error creating VM. See logs above."
|
log_critical "Fatal error starting container. See logs above."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
|
@ -226,7 +225,7 @@ _LXC_START_AND_WAIT() {
|
||||||
# Wait for container to start, we are using systemd to check this,
|
# Wait for container to start, we are using systemd to check this,
|
||||||
# for the sake of brevity.
|
# for the sake of brevity.
|
||||||
for j in $(seq 1 5); do
|
for j in $(seq 1 5); do
|
||||||
log_debug "Start VM attempt $j"
|
log_debug "Start container attempt $j"
|
||||||
if timeout -k 10 4 $lxc exec "$1" -- timeout 4 systemctl isolate multi-user.target >/dev/null 2>/dev/null; then
|
if timeout -k 10 4 $lxc exec "$1" -- timeout 4 systemctl isolate multi-user.target >/dev/null 2>/dev/null; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -242,7 +241,7 @@ _LXC_START_AND_WAIT() {
|
||||||
|
|
||||||
# Wait for container to access the internet
|
# Wait for container to access the internet
|
||||||
for j in $(seq 1 5); do
|
for j in $(seq 1 5); do
|
||||||
log_debug "Connect VM internet attempt $j"
|
log_debug "Connect container internet attempt $j"
|
||||||
# Note: Sometimes this uses X00% CPU and never times out, so we use timeout SIGKILL
|
# Note: Sometimes this uses X00% CPU and never times out, so we use timeout SIGKILL
|
||||||
if timeout -k 10 4 $lxc exec "$1" -- timeout 4 curl -s http://wikipedia.org > /dev/null 2>/dev/null; then
|
if timeout -k 10 4 $lxc exec "$1" -- timeout 4 curl -s http://wikipedia.org > /dev/null 2>/dev/null; then
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Reference in a new issue