snapd run from refresh-bits panics in InternalToolPath #25

Open
jhenstridge opened this Issue Sep 11, 2017 · 3 comments

Comments

Projects
None yet
2 participants

I was trying to use refresh-bits to test out a change to snapd, and had snapd panic with the following message:

2017/09/08 12:49:03 InternalToolPath can only be used from snapd, got: /home/james/src/.../snapd.amd64

This happened when I was trying to connect an interface that changed the mount configuration for the snap. The call in question seemed to come from interfaces/mount/ns.go, which doesn't seem to like the way refresh-bits builds snapd.

Owner

zyga commented Oct 23, 2017

Based on a conversation just a moment ago this is a self-defense mechanism that has gone a bit to far. As for devtools, I haven't used them myself in a while so there are probably a whole lot of things gone stale. For smaller things that I usually work with I resort to make hack

This is a bit of a hack, but the following seems to work to temporarily test out a new build of snapd without overwriting the distro packaged version:

go build ..../snapd
sudo systemctl stop snapd
sudo systemctl set-environment SNAP_REEXEC=0
sudo mount --bind $PWD/snapd /usr/lib/snapd/snapd
sudo systemctl start snapd

And to reverse the process:

sudo systemctl stop snapd
sudo umount /usr/lib/snapd/snapd
sudo systemctl unset-environment SNAP_REEXEC
sudo systemctl start snapd
Owner

zyga commented Nov 3, 2017

I also stop the socket sudo systemctl stop snapd.{socket,service}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment