Skip to content

Commit

Permalink
Revert lxd-stop-hook temporarily (#569)
Browse files Browse the repository at this point in the history
PR #564 has broken VMs,
needs more research.
  • Loading branch information
tomponline authored Oct 10, 2024
2 parents 912a3ef + 530d3c6 commit 822e3f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
17 changes: 3 additions & 14 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1401,12 +1401,7 @@ parts:
# Build the binaries
go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxc" github.com/canonical/lxd/lxc
# Build LXD server binary into ${CRAFT_PART_INSTALL}/sbin/lxd so that it does not conflict with the
# lxd-stophook wrapper script which is stored in ${CRAFT_PART_INSTALL}/bin/lxd.
# This way when a container stops it will call "/snap/lxd/current/bin/lxd callhook" which is handled by the
# lxd-stophook script, which in turn will execute "/snap/lxd/current/bin/lxd-user callhook" to notify LXD.
go build -trimpath -o "${CRAFT_PART_INSTALL}/sbin/lxd" -tags=libsqlite3 github.com/canonical/lxd/lxd
go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd" -tags=libsqlite3 github.com/canonical/lxd/lxd
# Build static binaries
CGO_ENABLED=0 go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd-agent" -tags=agent,netgo github.com/canonical/lxd/lxd-agent
Expand Down Expand Up @@ -1445,7 +1440,7 @@ parts:
usr/share/misc/: share/misc/
var/lib/usbutils/usb.ids: share/misc/
usr/sbin/: bin/
sbin/sgdisk: bin/
sbin/: bin/
prime:
- bin/dnsmasq
- bin/getfattr
Expand All @@ -1466,9 +1461,9 @@ parts:
- share/misc/usb.ids

- bin/lxc
- bin/lxd
- bin/lxd-agent
- bin/lxd-user
- sbin/lxd

lxd-ui:
source: https://github.com/canonical/lxd-ui
Expand Down Expand Up @@ -1551,12 +1546,10 @@ parts:
rm -rf "${CRAFT_PRIME}/usr/share/"
# Strip binaries (excluding shell scripts and LXCFS)
# The "${CRAFT_PRIME}/bin/lxd" file is ignored as that is the lxd-stophook wrapper script.
find "${CRAFT_PRIME}"/bin -type f \
-not -path "${CRAFT_PRIME}/bin/ceph" \
-not -path "${CRAFT_PRIME}/bin/editor" \
-not -path "${CRAFT_PRIME}/bin/lxc-checkconfig" \
-not -path "${CRAFT_PRIME}/bin/lxd" \
-not -path "${CRAFT_PRIME}/bin/nvidia-container-cli" \
-not -path "${CRAFT_PRIME}/bin/remote-viewer" \
-not -path "${CRAFT_PRIME}/bin/snap-query" \
Expand All @@ -1568,9 +1561,6 @@ parts:
-not -path "${CRAFT_PRIME}/bin/gpu-2404-custom-wrapper" \
-exec strip --strip-all {} +
# This is the actual LXD binary.
strip --strip-all "${CRAFT_PRIME}/sbin/lxd"
# Strip binaries not under bin/ due to being dynamically
# added to the path with `snap set lxd`, like `criu.enable=true`
for binary in "${CRAFT_PRIME}/criu/criu"; do
Expand Down Expand Up @@ -1612,7 +1602,6 @@ parts:
organize:
commands/snap-query: bin/
hooks/: snap/hooks/
wrappers/lxd-stophook: bin/lxd
wrappers/gpu-2404-custom-wrapper: bin/
wrappers/editor: bin/
wrappers/remote-viewer: bin/
Expand Down
8 changes: 0 additions & 8 deletions snapcraft/wrappers/lxd-stophook

This file was deleted.

0 comments on commit 822e3f2

Please sign in to comment.