mirror of
https://github.com/YunoHost/yunohost_demo.git
synced 2024-09-03 19:56:44 +02:00
less warnings
This commit is contained in:
parent
af5d9e4f37
commit
c3dee09570
4 changed files with 12 additions and 12 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue