Solved ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2

Hi!, I created a jail, and installed linux-c7 to be able to run wkhtmltopdf.

From inside the jail, when I chroot /compat/linux /bin/bash, I can run /usr/local/bin/wkhtmltopdf without issues, but I need to be able to run without that chroot.

If I try to run it without chroot, I get:

Code:
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2

My jail.conf

Code:
odoo {                                                                                        
       ip4.addr += "re0|192.168.100.211";    
       ip4=inherit;                                                                          
       ip6=inherit;                          
       allow.raw_sockets;
       allow.sysvipc=1;
       mount.devfs;                                
       devfs_ruleset=4;                            
       # HOSTNAME/PATH                             
       host.hostname = "${name}";                  
       path = "/datos/jails/containers/${name}";
       # MOUNT                                     
       mount += "linprocfs $path/compat/linux/proc    linprocfs rw  0 0";
       mount += "linsysfs  $path/compat/linux/sys     linsysfs  rw  0 0";
       mount += "devfs     $path/compat/linux/dev     devfs     rw  0 0";
       mount += "fdescfs   $path/compat/linux/dev/fd  fdescfs   rw,linrdlnk 0 0";
       mount += "tmpfs     $path/compat/linux/dev/shm tmpfs     rw,size=1g,mode=1777  0 0";
       mount += "/tmp      $path/compat/linux/tmp     nullfs    rw  0 0";
       mount += "/home     $path/compat/linux/home    nullfs    rw  0 0";
}

Inside the jail:

Code:
/etc/rc.conf
linux_enable="YES"

Code:
/etc/sysctl.conf
compat.linux.emul_path=/compat/linux
 
A workaround is this:

As I can run wkhtmltopdf from a chroot, and the program is in /compat/linux/usr/local/bin/wkhtmltopdf, I just created a shell wrapper in /usr/local/bin/wkhtmltopdf, with this contents:

Code:
#!/bin/sh
exec /usr/sbin/chroot /compat/linux /usr/local/bin/wkhtmltopdf "$@"

And chmod +x /usr/local/bin/wkhtmltopdf

That's all, now I can run it from anywhere in the jail.
 
Not sure it wors for anything running inside jail, but to use Linux apps on Linuxulator, isn't creating ports (regardless you file a bug to be incorporated in official ports tree or not) the easiest?

I think USES=linux and USE_LINUX=(list any component you need) would do the right thing for you. Not mine, but an exapmple here.
 
Back
Top