python27 with SEM option (p1003b) in jail and FreeBSD 8.2 -> 9.0

C, C++, Python, Perl, Shell, etc.

python27 with SEM option (p1003b) in jail and FreeBSD 8.2 -> 9.0

Postby lahondes » 07 May 2012, 16:46


When we upgraded our [del]Freebsd[/del] FreeBSD 8.2 to 9.0, we broke one of our python programs which use Pyro and depend on posix semaphores.

Now when building python2.7.3 through ports, choosing the SEM option in [FILE]make config[/FILE] and building, semaphores do not work although they worked on 8.2 with the same settings.

In a jail:
Code: Select all
# python
Python 2.7.3 (default, May  7 2012, 18:16:58)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing.queues import SimpleQueue
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/multiprocessing/", line 48, in <module>
    from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, Condition
  File "/usr/local/lib/python2.7/multiprocessing/", line 59, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required
 synchronization primitives needed will not function, see issue 3770.

I have in [FILE]sysctl[/FILE]:
Code: Select all

It works out of jails. I have tried to tweak another jail security parameter:
Code: Select all

but it does not help.

I am also worried by the fact that some of my related [FILE]sysctl[/FILE] settings do not seem to be taken into account:

Code: Select all

[CMD=" "]# sysctl p1003_1b.sem_nsems_max[/CMD]
Code: Select all
p1003_1b.sem_nsems_max: 0


[CMD=" "]# sysctl p1003_1b.sem_nsems_max=1000[/CMD]
Code: Select all
p1003_1b.sem_nsems_max: 0 -> 0

(the[FILE]-w[/FILE] option gives the same result).
Junior Member
Posts: 3
Joined: 07 May 2012, 16:16

About the rules

Postby lahondes » 08 May 2012, 07:02

I am really sorry about all the rules I have broken, I did not come across these posts you refer to in the signature at the end of my post. As for the different grammar errors, I do not write often in English and I focused on technical details. I have really tried to remember in the forum registration procedure where I missed these important rules and I could not find them out. I find that a great correction job was done and I am really sorry to have cause all this work. However, as a FreeBSD Forum newbie, I find the form of the remark a little rude.

I have been carefully repeating this issue about python, semaphore and jail, which I find quite challenging, at least for me, and I am slightly upset about the 'zero effort' at the end of my own post. Once again, however, I apologize for all the broken rules and I appreciate the seriousness and quality of the forum and will do my best to be up to it.

Junior Member
Posts: 3
Joined: 07 May 2012, 16:16

[solved] thanks to ezjail-admin but be carefull with update -U

Postby lahondes » 08 May 2012, 08:31

So much for my pride: I have carefully checked my jail again and discovered that the base jail had not been updated using :

[cmd=]ezjail-admin update -u[/cmd]

The [FILE]-U[/FILE] would not work. I re-read the man page and discovered that [FILE]-U[/FILE] only works before installing and rebooting. To correct the base jail, I ran:

[cmd=]ezjail-admin install[/cmd]

Which installed a 9.0-RELEASE base jail. The compilation of python with SEM option did work then.

However, the message given by

[cmd=]ezjaiil-admin update -u[/cmd]

which says "no update necessary" is quite confusing in fact.

Apart from that, jails are very satisfying in general and [FILE]ezjail-admin[/FILE] is a very simple and great system to maintain them.
Junior Member
Posts: 3
Joined: 07 May 2012, 16:16

Return to Userland Programming & Scripting

Who is online

Users browsing this forum: No registered users and 0 guests