Move kill package_check to lxc_force_stop

This commit is contained in:
Maniack Crudelis 2019-03-09 18:09:10 +01:00
parent 85f99ecdf7
commit eba30867c4
3 changed files with 12 additions and 2 deletions

View file

@ -193,7 +193,8 @@ then
fi fi
fi fi
# Create the lock file # Create the lock file
echo "start:$(date +%s)" > "$lock_file" # $$ is the PID of package_check itself.
echo "start:$(date +%s):$$" > "$lock_file"
#================================================= #=================================================
# Check the internet connectivity # Check the internet connectivity

View file

@ -11,6 +11,12 @@ LXC_NAME=$(cat "$pcheck_config" | grep LXC_NAME= | cut -d '=' -f2)
LXC_BRIDGE=$(cat "$pcheck_config" | grep LXC_BRIDGE= | cut -d '=' -f2) LXC_BRIDGE=$(cat "$pcheck_config" | grep LXC_BRIDGE= | cut -d '=' -f2)
main_iface=$(cat "$pcheck_config" | grep iface= | cut -d '=' -f2) main_iface=$(cat "$pcheck_config" | grep iface= | cut -d '=' -f2)
echo "> Arrêt de package_check"
# Kill package_check
# Retrieve the pid of Package check
package_check_pid="$(cat "$script_dir/../pcheck.lock" | cut -d: -f3)"
sudo kill --signal 15 $package_check_pid
echo "> Arrêt du conteneur" echo "> Arrêt du conteneur"
if [ $(sudo lxc-info --name $LXC_NAME | grep -c "STOPPED") -eq 0 ]; then if [ $(sudo lxc-info --name $LXC_NAME | grep -c "STOPPED") -eq 0 ]; then
echo "Arrêt du conteneur $LXC_NAME" echo "Arrêt du conteneur $LXC_NAME"
@ -39,3 +45,5 @@ then
fi fi
sudo lxc-ls -f sudo lxc-ls -f
sudo rm "$script_dir/../pcheck.lock"

View file

@ -1455,7 +1455,8 @@ TEST_LAUNCHER () {
stop_timer 2 stop_timer 2
# Update the lock file with the date of the last finished test. # Update the lock file with the date of the last finished test.
echo "$1 $2:$(date +%s)" > "$lock_file" # $$ is the PID of package_check itself.
echo "$1 $2:$(date +%s):$$" > "$lock_file"
} }
set_witness_files () { set_witness_files () {