1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Userland Programming and Scripting' started by lahondes, May 7, 2012.

  1. lahondes

    lahondes New Member

    Thanks Received:

    When we upgraded our Freebsd 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 make config and building, semaphores do not work although they worked on 8.2 with the same settings.

    In a jail:
    # 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/queues.py", line 48, in <module>
        from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, Condition
      File "/usr/local/lib/python2.7/multiprocessing/synchronize.py", 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 sysctl:

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

    but it does not help.

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


    # sysctl p1003_1b.sem_nsems_max
    p1003_1b.sem_nsems_max: 0


    # sysctl p1003_1b.sem_nsems_max=1000
    p1003_1b.sem_nsems_max: 0 -> 0

    (the-w option gives the same result).
  2. lahondes

    lahondes New Member

    Thanks Received:
    About the rules

    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.

  3. lahondes

    lahondes New Member

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

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

    ezjail-admin update -u

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

    ezjail-admin install

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

    However, the message given by

    ezjaiil-admin update -u

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

    Apart from that, jails are very satisfying in general and ezjail-admin is a very simple and great system to maintain them.