Issue with sched_getaffinity(0) in jails

JonM

Dabbler
Joined
Mar 29, 2017
Messages
19
Hi all,

I've not been able to find anything about this anywhere do I'm hoping someone can help?

I've been trying to install python packages from pip in a virtual environment I'm a jail, specifically zlib-ng but I'm coming across an issue where the use of sched_getaffinity in the packages causes the install to fail.

I did find a post from a few years ago on the freebsd forum about sched_getaffinity not working properly in truenas jails but unfortunately it was met with truenas isn't supported here and no replies.

Anyone else seen this issue and know of a work around or how to make sched_getaffinity work properly in a truenas jail (seems it's fine on plain freebsd)?

I'm really stuck without this python package.

Thanks for any help!
Jon
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
AFAIK you cannot use the cpuset family of system calls inside a jail. Since a virtual environment does not touch the global install, how about trying the install from the NAS host system - into a venv directory located in the jail, of course.

I don't know if the software will subsequently work, but you could get past the install problem that way.
 

JonM

Dabbler
Joined
Mar 29, 2017
Messages
19
Ah that's a great idea! It'll mean installing python and stuff on the host though, which I've gathered is not advised. But I can undo all of that once I've got the package in my jail.

I'll give this a go tomorrow and report back on what happens

Thanks!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Ah that's a great idea! It'll mean installing python and stuff on the host though, which I've gathered is not advised.
Python is a regular part of TrueNAS, no need to mess with the system:
Code:
root@freenas[~]# python --version
Python 3.9.16
root@freenas[~]# which python
/usr/local/bin/python

I would not have made that suggestion, otherwise.
 

JonM

Dabbler
Joined
Mar 29, 2017
Messages
19
Ah I see... This would need to be built for python 3.11 unfortunately.

Do you think there would be another way so I could avoid messing with the system?

I was thinking I might be able to track down the cached pip installation files and just edit the bit that calls sched_getaffinity but I've not managed it so far.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Build in a FreeBSD VM, then copy to jail?
 
Top