1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lxd_ynh.git synced 2024-09-03 19:45:53 +02:00

Merge pull request #1 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2021-03-17 12:31:53 +01:00 committed by GitHub
commit 1a6047fe23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 9 deletions

View file

@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
LXD is a next generation system container manager. It offers a user experience similar to virtual machines but using Linux containers instead.
**Shipped version:** 4.11
**Shipped version:** 4.12
## Demo

View file

@ -4,6 +4,7 @@
pkg_linter=1
setup_nourl=1
upgrade=1
upgrade=1 from_commit=cb39602175d6fe3f13335c33c6c9276f7aa980a2
backup_restore=1
;;; Options
Email=

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/lxc/lxd/releases/download/lxd-4.11/lxd-4.11.tar.gz
SOURCE_SUM=3d70bb0a07b6b343b1ff4b06f62d11147d205b30a808abc13978ea18ebed8fdd
SOURCE_URL=https://github.com/lxc/lxd/releases/download/lxd-4.12/lxd-4.12.tar.gz
SOURCE_SUM=3c5b87eb20e49f11084afb29224b6bad7a69bbdd8eaa99941c106149234bf1e1
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -9,6 +9,8 @@ Environment=LXD_OVMF_PATH=/usr/share/ovmf/x64
ExecStart=/usr/local/bin/__APP__ --group=__APP__ --logfile=/var/log/__APP__/__APP__.log
ExecStartPost=/usr/local/bin/__APP__ waitready --timeout=600
ExecStop=/usr/local/bin/__APP__ shutdown
User=root
Group=root
TimeoutStartSec=600s
TimeoutStopSec=30s
Restart=on-failure

View file

@ -5,7 +5,7 @@
"description": {
"en": "Offers a user experience similar to virtual machines but using Linux containers instead."
},
"version": "4.11~ynh1",
"version": "4.12~ynh1",
"url": "https://example.com",
"license": "Apache-2.0",
"maintainer": {

View file

@ -54,6 +54,7 @@ ynh_backup --src_path="/usr/local/bin/lxc"
ynh_backup --src_path="/usr/local/bin/lxd"
ynh_backup --src_path="/usr/local/bin/lxc-to-lxd"
ynh_backup --src_path="/usr/local/bin/lxd-p2c"
ynh_backup --src_path="/etc/bash_completion.d/lxd-client"
ynh_backup --src_path="/etc/dnsmasq.d/lxd"

View file

@ -86,6 +86,7 @@ mkdir -p /usr/local/lib/$app
mkdir -p /var/log/$app
cp -a ${GOPATH}/deps/{raft,dqlite}/.libs/lib*.so* /usr/local/lib/$app/
cp ${GOPATH}/bin/{lxc,lxd,lxc-to-lxd,lxd-p2c} /usr/local/bin
cp ${lxd_tmp}/scripts/bash/lxd-client /etc/bash_completion.d/
popd
ynh_secure_remove --file="$go_tmp"
@ -126,7 +127,8 @@ ynh_store_file_checksum --file="/etc/ld.so.conf.d/$app.conf"
ldconfig
echo "root:1000000:65536 # Added by lxd#" | tee -a /etc/subuid /etc/subgid
echo "# Added by lxd
root:100000:65536" | tee -a /etc/subuid /etc/subgid
#=================================================
# GENERIC FINALIZATION

View file

@ -76,8 +76,9 @@ ynh_secure_remove --file="/usr/local/bin/lxc"
ynh_secure_remove --file="/usr/local/bin/lxd"
ynh_secure_remove --file="/usr/local/bin/lxc-to-lxd"
ynh_secure_remove --file="/usr/local/bin/lxd-p2c"
ynh_secure_remove --file="/etc/bash_completion.d/lxd-client"
sed -i "/root:1000000:65536 # Added by lxd#/d" /etc/sub{uid,gid}
sed -i "/# Added by lxd$/{N;/root:100000:65536/d}" /etc/sub{u,g}id
#=================================================
# GENERIC FINALIZATION
@ -93,7 +94,7 @@ ynh_system_user_delete --username=$app
# INFO TO REMOVE CONTAINERS
#=================================================
ynh_print_warn --message="If you really want to delete all containers and files related to lxd please run \"sudo rm /var/lib/lxd -rf\""
ynh_print_warn --message="If you really want to delete all containers and files related to lxd please run \"rm /var/lib/lxd -rf\""
#=================================================
# END OF SCRIPT

View file

@ -83,6 +83,7 @@ ynh_restore_file --origin_path="/usr/local/bin/lxc"
ynh_restore_file --origin_path="/usr/local/bin/lxd"
ynh_restore_file --origin_path="/usr/local/bin/lxc-to-lxd"
ynh_restore_file --origin_path="/usr/local/bin/lxd-p2c"
ynh_restore_file --origin_path="/etc/bash_completion.d/lxd-client"
ynh_restore_file --origin_path="/etc/dnsmasq.d/lxd"
@ -92,7 +93,8 @@ ynh_restore_file --origin_path="/etc/ld.so.conf.d/$app.conf"
ldconfig
echo "root:1000000:65536 # Added by lxd#" | tee -a /etc/subuid /etc/subgid
echo "# Added by lxd
root:100000:65536" | tee -a /etc/subuid /etc/subgid
#=================================================
# START SYSTEMD SERVICE

View file

@ -21,6 +21,8 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
sed -i "/root:1000000:65536 # Added by lxd#/d" /etc/sub{u,g}id
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -92,6 +94,7 @@ mkdir -p /usr/local/lib/$app
mkdir -p /var/log/$app
cp -a ${GOPATH}/deps/{raft,dqlite}/.libs/lib*.so* /usr/local/lib/$app/
cp ${GOPATH}/bin/{lxc,lxd,lxc-to-lxd,lxd-p2c} /usr/local/bin
cp ${lxd_tmp}/scripts/bash/lxd-client /etc/bash_completion.d/
popd
ynh_secure_remove --file="$go_tmp"
@ -136,7 +139,8 @@ ynh_store_file_checksum --file="/etc/ld.so.conf.d/$app.conf"
ldconfig
echo "root:1000000:65536 # Added by lxd#" | tee -a /etc/subuid /etc/subgid
echo "# Added by lxd
root:100000:65536" | tee -a /etc/subuid /etc/subgid
#=================================================
# GENERIC FINALIZATION