diff --git a/snapcraft.yaml b/snapcraft.yaml index 4c586faf0..c128b38f9 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1438,6 +1438,9 @@ parts: git cherry-pick -x 47180a352654bee9a994db714801813a59cfbb18 # lxd/apparmor/feature_check: add infastructure to check AppArmor features git cherry-pick -x b5a4a6540e793120b85a3b280003fce236e6a56f # lxd/apparmor/instance_lxc: allow nosymfollow mount flag git cherry-pick -x 86c3d515662068d825d23387623932bca96bc6aa # lxd/apparmor/instance_lxc: allow nosymfollow mount flag in more cases + git cherry-pick -x 69bd88119f5dc990452c79699915b3dd86dad242 # lxd/storage/backend/lxd: Pass full snapshot name when validating import in CreateInstanceFromBackup + git cherry-pick -x a35079f481c50adf7dfd571d2c815668f5f747a1 # lxd/instance/instance/utils: Don't allow snapshots named ".." in ValidName + git cherry-pick -x fcdc78dda31b210f246e075aaf4bf507b07b68f5 # lxd/instance: if storage location is remote, make cluster self healing available, and vm can migrate when src member is offline also # Setup build environment export GOPATH="$(realpath ./.go)" diff --git a/snapcraft/commands/daemon.start b/snapcraft/commands/daemon.start index 536b8209c..db84d98b9 100755 --- a/snapcraft/commands/daemon.start +++ b/snapcraft/commands/daemon.start @@ -695,6 +695,12 @@ if [ "${daemon_verbose:-"false"}" = "true" ]; then CMD="${CMD} --verbose" fi +# Check if this is the first time LXD is started. +FIRSTRUN="false" +if [ ! -d "${SNAP_COMMON}/lxd/database" ]; then + FIRSTRUN="true" +fi + # We deal with errors ourselves from this point on set +e @@ -740,12 +746,11 @@ if [ "${RET}" -gt "0" ]; then exit 1 fi -## Check if this is the first time LXD is started -if [ ! -d "${SNAP_COMMON}/lxd/database" ]; then +## Process preseed if present +if [ "${FIRSTRUN}" = "true" ]; then set -e echo "=> First LXD execution on this system" - ## Process preseed if present if [ -e "${SNAP_COMMON}/init.yaml" ]; then echo "==> Running LXD preseed file" ${LXD} init --preseed < "${SNAP_COMMON}/init.yaml"