/hab/svc/$package/var symlinks broken in docker export


#1

Running into an issue where some symlinks from /hab/pkgs/$pkg/$version/$datestamp/app into /hab/svc/$pkg/var are broken in a docker-exported habitat image. Specifically links into tmp and log are broken because those directories don’t exist. It’s not clear if it’s a permission problem at build time and the directories are failing to be created, or if their creation is simply not being attempted. This package uses to the default ruby scaffolding for building.

Is this a known issue? Some searching around hasn’t revealed anything useful.

If it’s not a known issue, I’m planning on creating a step in my init hook to create those directories to see if it works around it. Is there a different approach that would be recommended?


#2

You’d need to create tmp and log in the init hook to satisfy the link. Anything you create in the /hab/svc directory at build time won’t get carried over into the pacakge.


#3

Indeed, the contents of the plan.sh are mostly build time concerns, @elliott-davis’s got the right answer on this one - you’d basically want the init hook to create the paths (and also the symlinks) when the service starts