diff --git a/scripts/install b/scripts/install index 382c547..375d92f 100755 --- a/scripts/install +++ b/scripts/install @@ -126,7 +126,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 diff --git a/scripts/remove b/scripts/remove index 984298f..4eff0ab 100755 --- a/scripts/remove +++ b/scripts/remove @@ -77,7 +77,7 @@ 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" -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 diff --git a/scripts/restore b/scripts/restore index a060a33..6b2e2bb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -92,7 +92,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 diff --git a/scripts/upgrade b/scripts/upgrade index e5b4646..ceb6ff8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #================================================= @@ -136,7 +138,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