Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
[#248] ld_preload systemd shared lib to fix debian lib load
Browse files Browse the repository at this point in the history
  • Loading branch information
n0rad committed Jul 10, 2017
1 parent a256397 commit 3fba916
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aci-builder/bin-run/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,18 @@ func (b *Builder) runBuild() error {
func (b *Builder) prepareNspawnArgsAndEnv(commandPath string) ([]string, []string, error) {
var args []string
env := os.Environ()
env = append(env, "LD_LIBRARY_PATH="+b.stage1Rootfs+"/dgr/usr/lib")
env = append(env, "LD_PRELOAD="+b.stage1Rootfs+"/dgr/usr/lib/libsystemd-shared-232.so") // debian lib dir hell
args = append(args, b.stage1Rootfs+"/dgr/usr/lib/ld-linux-x86-64.so.2")
args = append(args, "--library-path")
args = append(args, b.stage1Rootfs+"/dgr/usr/lib")
args = append(args, b.stage1Rootfs+"/dgr/usr/bin/systemd-nspawn")
if context := os.Getenv(rktcommon.EnvSELinuxContext); context != "" {
args = append(args, fmt.Sprintf("-Z%s", context))
}
args = append(args, "--register=no")
args = append(args, "-q")
args = append(args, "--link-journal=auto")
env = append(env, "LD_LIBRARY_PATH="+b.stage1Rootfs+"/dgr/usr/lib")
if !logs.IsDebugEnabled() {
args = append(args, "--quiet")
}
Expand Down

0 comments on commit 3fba916

Please sign in to comment.