diff --git a/snapcraft.yaml b/snapcraft.yaml index 285f66d84..3d6edfae5 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1602,6 +1602,7 @@ 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/ diff --git a/snapcraft/wrappers/lxd-stophook b/snapcraft/wrappers/lxd-stophook new file mode 100755 index 000000000..55dc33177 --- /dev/null +++ b/snapcraft/wrappers/lxd-stophook @@ -0,0 +1,8 @@ +#!/bin/sh +# Use exec so that this script process is replaced. +# This avoids polluting the process tree with this wrapper script. +if [ "$1" = "callhook" ]; then + exec /snap/lxd/current/bin/lxd-user "$@" +fi + +exec lxd "$@"