Summary: | app-emulation/lxd-4.0.4 lxd-agent needs to be a statically compiled executable | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Joe Kowalski <bugmail> |
Component: | Current packages | Assignee: | Joonas Niilola <juippis> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jstein, virtualization |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Joe Kowalski
2020-11-03 09:19:52 UTC
Does this work with 4.0.3-r2? I could introduce a 'static' USE to restore previous behaviour. (In reply to Joonas Niilola from comment #1) > Does this work with 4.0.3-r2? I could introduce a 'static' USE to restore > previous behaviour. Sorry for the delay - it took me a bit to get a non-production box I could downgrade to the 4.0.3-r2 ebuild on to test this (lxd does not like downgrades). But it looks like even the older ebuild still has lxd-agent as a dynamicly linked binary: [~]>equery l lxd * Searching for lxd ... [IP-] [ ] app-emulation/lxd-4.0.3-r2:0 [~]>ldd /usr/bin/lxd-agent linux-vdso.so.1 (0x00007ffcc0b80000) libutil.so.1 => /lib64/libutil.so.1 (0x00007fe8d93c5000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe8d93a5000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fe8d93a0000) liblxc.so.1 => /usr/lib64/liblxc.so.1 (0x00007fe8d92d7000) libacl.so.1 => /lib64/libacl.so.1 (0x00007fe8d92cc000) libsqlite3.so.0 => /usr/lib/lxd/libsqlite3.so.0 (0x00007fe8d91ef000) libraft.so.0 => /usr/lib/lxd/libraft.so.0 (0x00007fe8d91cb000) libco.so.0 => /usr/lib/lxd/libco.so.0 (0x00007fe8d91c6000) libdqlite.so.0 => /usr/lib/lxd/libdqlite.so.0 (0x00007fe8d91a4000) libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_s.so.1 (0x00007fe8d918a000) libc.so.6 => /lib64/libc.so.6 (0x00007fe8d8fce000) /lib64/ld-linux-x86-64.so.2 (0x00007fe8d9418000) libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007fe8d8d11000) libseccomp.so.2 => /usr/lib64/libseccomp.so.2 (0x00007fe8d8cc2000) libcap.so.2 => /lib64/libcap.so.2 (0x00007fe8d8cb7000) libz.so.1 => /lib64/libz.so.1 (0x00007fe8d8c9d000) libuv.so.1 => /usr/lib64/libuv.so.1 (0x00007fe8d8c6a000) Not a staticly linked binary that lxd seems to build by default as the main makefile in git seems to set: lxd-agent: CGO_ENABLED=0 go install -v -tags agent,netgo ./lxd-agent @echo "LXD agent built successfully" The rest of the binaries could probably still be dynamically linked to the system libs, but I don't see a way to make the agent work without it being static since it needs to run in a wide variety of vm's. Manually compiling lxd from scratch and replacing the static lxd-agent binary that produces does make a working lxd agent in a lxd vm. Did you try compiling from their Github master, or 4.0.4 release tarball? Because I'm trying with 4.0.4 and am running into multiple issues with static-linking. I saw their upstream issue, https://github.com/lxc/lxd/issues/7187 which seemed to have landed on 4.2 release. Can you get it to work on 4.0.4 and if yes, how? I've tried agent? ( app-emulation/lxc[static-libs] dev-db/sqlite[static-libs] dev-libs/dqlite[static-libs] dev-libs/libuv[static-libs] dev-libs/raft[static-libs] sys-devel/gettext[static-libs] sys-libs/libcap[static-libs] sys-libs/libseccomp[static-libs] sys-libs/zlib[static-libs] virtual/acl[static-libs] if use agent; then go build -v -tags "agent" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lraft -ldqlite -luv -lseccomp -lcap"' -o . ./lxd-agent/... || die go build -v -tags "netgo" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lraft -ldqlite -luv -lseccomp -lcap"' -o . ./lxd-p2c/... || die fi (and it doesn't even work if I try to build it manually outside portage) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d05a7c3f79a987247f5e43260a299eccab75c06 commit 5d05a7c3f79a987247f5e43260a299eccab75c06 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2021-05-01 05:37:09 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-05-01 05:38:47 +0000 app-emulation/lxd: bump to 4.0.6 - build lxd-agent statically, #752480 Bug: https://bugs.gentoo.org/752480 Signed-off-by: Joonas Niilola <juippis@gentoo.org> app-emulation/lxd/Manifest | 2 + app-emulation/lxd/lxd-4.0.6.ebuild | 156 +++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) Attempted a fix, at least it builds for me now. But I have no means to test whether it works or not, and would appreciate feedback. Not the original reporter, but I hit a similar problem when trying out LXD first with 4.0.5. Regardless of the VM image I tried, all returned "failed to connect to lxd-agent". I'm not able to confirm that the dynamically linked executable was the problem, as I wasn't able to log into the VM images at all (no root PW set, no SSH installed in the standard images). But I just found this bug, updated to 4.0.6 via portage, and now I'm able to connect with "lxc exec my-vm bash" successfully. Can confirm that lxd-agent is build statically now and works as expected. Thanks! Let's try to keep it this way then. |