Skip to content

Commit

Permalink
Revert "daemon.start: group first run detection"
Browse files Browse the repository at this point in the history
This reverts commit 14cf45b.

Signed-off-by: Mark Bolton <[email protected]>
  • Loading branch information
boltmark committed Jul 26, 2024
1 parent a8a1ab6 commit 39bd791
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,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

Expand Down Expand Up @@ -754,12 +760,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"
Expand Down

0 comments on commit 39bd791

Please sign in to comment.