From 5fa78d5de05e947bc68c09fecf3a94db63d8c388 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 29 Nov 2020 20:47:37 +0100 Subject: [PATCH] Fuck this we should not have to implement a mechanism that check if apt is being used --- sub_scripts/launcher.sh | 17 ----------------- sub_scripts/lxc_build.sh | 4 ++++ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/sub_scripts/launcher.sh b/sub_scripts/launcher.sh index acb0960..807ed9f 100755 --- a/sub_scripts/launcher.sh +++ b/sub_scripts/launcher.sh @@ -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 diff --git a/sub_scripts/lxc_build.sh b/sub_scripts/lxc_build.sh index 7c17d82..4e16040 100755 --- a/sub_scripts/lxc_build.sh +++ b/sub_scripts/lxc_build.sh @@ -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