What you get is this: Executing: gluster peer probe 10.1.120.11 ... Traceback (most recent call last): File "/usr/libexec/glusterfs/python/syncdaemon/gsyncd.py", line 16, in from ipaddr import IPAddress, IPNetwork File "/usr/libexec/glusterfs/python/syncdaemon/ipaddr.py", line 1468 ip_int = 0L ^ SyntaxError: invalid syntax The reason for that is that the gsyncd executable contains an explicit python path "/usr/bin/python" which points correctly to python2 at build time due to python_set_active_version 2, but points to python3 at runtime if the system interpreter version is set to 3. In other terms: it ignores the shebangs on most of its python scripts but uses the interpreter it detects at compile time. This is what I am doing to fix it: --- /var/repositories/gentoo-x86/sys-cluster/glusterfs/glusterfs-3.3.1.ebuild 2012-12-07 09:34:12.000000000 +0100 +++ glusterfs-3.3.1-r1.ebuild 2012-12-07 08:26:41.000000000 +0100 @@ -60,6 +60,12 @@ --docdir=/usr/share/doc/${PF} --localstatedir=/var ) + + # glusterfs records the python executable in the gsyncd executable + # and executes python scripts without considering their shebang, breaking + # things with python3 set as system interpreter. Forcing it to use python2 directly. + export PYTHON="${PREFIX}/usr/bin/python2" + autotools-utils_src_configure }
Created attachment 334544 [details] New ebuild with Tiziano's patch applied The latest stable version of glusterfs (3.3.1) builds and works as expected with this ebuild.
Is that really needed? I have something like this on my box: $ head -n 1 gsyncd.py #!/usr/bin/env python2 $ head -n 1 ipaddr.py #!/usr/bin/python2
(In reply to comment #2) > Is that really needed? I have something like this on my box: > > $ head -n 1 gsyncd.py > #!/usr/bin/env python2 > $ head -n 1 ipaddr.py > #!/usr/bin/python2 Nvm, I now understand the issue: $ strings /usr/libexec/glusterfs/gsyncd | grep python /usr/bin/python /usr/libexec/glusterfs/python/syncdaemon/gsyncd.py exec of /usr/bin/python failed
+ 06 Jan 2013; Kacper Kowalik <xarthisius@gentoo.org> glusterfs-3.3.1.ebuild: + Force gsyncd to use python2 wrt #446330 by Tiziano Müller <dev- + zero@gentoo.org>