diff --git a/demo_lxc_build.sh b/demo_lxc_build.sh index 7811351..02b215c 100755 --- a/demo_lxc_build.sh +++ b/demo_lxc_build.sh @@ -152,21 +152,21 @@ fi ynh_print_info --message="> Creating a snapshot for $lxc_name1" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_lxc_create_snapshot --name="$lxc_name1" --snapname="snap0" -ynh_print_info --message="> Upgrading the $lxc_name1" | tee -a "$LOG_BUILD_LXC" 2>&1 +ynh_print_info --message="> Upgrading the $lxc_name1 LXC container" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_lxc_stop --name="$lxc_name1" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_lxc_upgrade_demo --name=$lxc_name1 --time_to_switch=$time_to_switch +ynh_lxc_upgrade_demo --name=$lxc_name1 --time_to_switch=$time_to_switch | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_print_info --message="> Cloning $lxc_name1 to $lxc_name2" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_lxc_clone --source="$lxc_name1" --destination="$lxc_name2" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_print_info --message="> Creating a snapshot for $lxc_name2" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_lxc_create_snapshot --name="$lxc_name2" --snapname="snap0" +ynh_lxc_create_snapshot --name="$lxc_name2" --snapname="snap0" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_print_info --message="> Setuping the switch cron" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_add_config --template="$final_path/conf/cron_demo_switch" --destination="/etc/cron.d/demo_switch" +ynh_add_config --template="$final_path/conf/cron_demo_switch" --destination="/etc/cron.d/demo_switch" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_print_info --message="> and the upgrade cron" | tee -a "$LOG_BUILD_LXC" 2>&1 -ynh_add_config --template="$final_path/conf/cron_demo_upgrade" --destination="/etc/cron.d/demo_upgrade" +ynh_add_config --template="$final_path/conf/cron_demo_upgrade" --destination="/etc/cron.d/demo_upgrade" | tee -a "$LOG_BUILD_LXC" 2>&1 ynh_print_info --message="> Setuping the service" | tee -a "$LOG_BUILD_LXC" 2>&1 #ynh_add_systemd_config --template="$final_path/conf/systemd.service" diff --git a/demo_lxc_destroy.sh b/demo_lxc_destroy.sh index 889792e..9e265d8 100755 --- a/demo_lxc_destroy.sh +++ b/demo_lxc_destroy.sh @@ -22,9 +22,9 @@ ynh_print_info --message=">> Starting demo destroy." /bin/bash "$final_path/demo_stop.sh" -f ynh_print_info --message="> Deleting containers and snapshots" -ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name1/snap0.tar.gz" +ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name1/snap0.tar.gz" ynh_lxc_delete --name=$lxc_name1 -ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name2/snap0.tar.gz" +ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/snapshots/$lxc_name2/snap0.tar.gz" ynh_lxc_delete --name=$lxc_name2 ynh_print_info --message="> Deleting crons" diff --git a/demo_stop.sh b/demo_stop.sh index f5b2024..c9d9b20 100755 --- a/demo_stop.sh +++ b/demo_stop.sh @@ -20,10 +20,10 @@ ynh_print_info --message=">> Stopping demo." | tee -a "$final_path/demo_boot.log if [ "$#" -eq 1 ] && [ "$1" == "-f" ] then ynh_print_info --message="> Deleting locks and force stopping LXC containers." | tee -a "$final_path/demo_boot.log" 2>&1 - ynh_secure_remove --file="/var/lib/lxd/$lxc_name1.lock_fileS" - ynh_secure_remove --file="/var/lib/lxd/$lxc_name2.lock_fileS" - ynh_secure_remove --file="/var/lib/lxd/$lxc_name1.lock_fileU" - ynh_secure_remove --file="/var/lib/lxd/$lxc_name2.lock_fileU" + ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/$lxc_name1.lock_fileS" + ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/$lxc_name2.lock_fileS" + ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/$lxc_name1.lock_fileU" + ynh_exec_warn_less ynh_secure_remove --file="/var/lib/lxd/$lxc_name2.lock_fileU" else ynh_print_info --message="> Waiting locks." | tee -a "$final_path/demo_boot.log" 2>&1 while test -e /var/lib/lxd/$lxc_name1.lock_file* || test -e /var/lib/lxd/$lxc_name2.lock_file*; do diff --git a/ynh_lxd_demo b/ynh_lxd_demo index e16b3c3..51a99db 100644 --- a/ynh_lxd_demo +++ b/ynh_lxd_demo @@ -157,7 +157,7 @@ ynh_lxc_upgrade_demo() { if [ "$update_apt" -eq "1" ] then # Archivage du snapshot - tar -cz --acls --xattrs -f /var/lib/lxd/snapshots/$name/snap0.tar.gz /var/lib/lxd/snapshots/$name/snap0 + ynh_exec_warn_less tar -cz --acls --xattrs -f /var/lib/lxd/snapshots/$name/snap0.tar.gz /var/lib/lxd/snapshots/$name/snap0 # Remplacement du snapshot ynh_lxc_create_snapshot --name=$name --snapname=snap0