Fuck this we should not have to implement a mechanism that check if apt is being used

This commit is contained in:
Alexandre Aubin 2020-11-29 20:47:37 +01:00
parent 2772b2feaf
commit 5fa78d5de0
2 changed files with 4 additions and 17 deletions

View file

@ -295,23 +295,6 @@ $(cat "$script_dir/sub_scripts/Build_lxc.log")"
# Count the number of lines of the current yunohost log file.
COPY_LOG 1
# Wait for apt to be available before the test.
apt_lock=0
for try in `seq 1 17`
do
# Check if /var/lib/dpkg/lock is used by another process
if sudo lxc-attach -n $lxc_name -- lsof /var/lib/dpkg/lock > /dev/null
then
echo "apt is already in use..."
apt_lock=1
# Sleep an exponential time at each round
sleep $(( try * try ))
fi
done
if [ $apt_lock -eq 1 ]; then
echo "apt has released its lock."
fi
# Copy the package into the container.
rsync -rq --delete "$package_path" "$lxc_name": >> "$test_result" 2>&1

View file

@ -253,6 +253,10 @@ ssh $ARG_SSH $LXC_NAME "systemctl -q disable apt-daily.timer" | tee -a "$LOG_BUI
ssh $ARG_SSH $LXC_NAME "systemctl -q disable apt-daily-upgrade.timer" | tee -a "$LOG_BUILD_LXC" 2>&1
ssh $ARG_SSH $LXC_NAME "systemctl -q disable apt-daily.service" | tee -a "$LOG_BUILD_LXC" 2>&1
ssh $ARG_SSH $LXC_NAME "systemctl -q disable apt-daily-upgrade.service" | tee -a "$LOG_BUILD_LXC" 2>&1
ssh $ARG_SSH $LXC_NAME "rm -f /etc/cron.daily/apt-compat" | tee -a "$LOG_BUILD_LXC" 2>&1
ssh $ARG_SSH $LXC_NAME "cp /bin/true /usr/lib/apt/apt.systemd.daily" | tee -a "$LOG_BUILD_LXC" 2>&1
echo -e "\e[1m> Post install Yunohost\e[0m" | tee -a "$LOG_BUILD_LXC"
ssh $ARG_SSH $LXC_NAME "sudo yunohost tools postinstall --domain $DOMAIN --password $YUNO_PWD --force-password" | tee -a "$LOG_BUILD_LXC" 2>&1