#! line on samweb script breaks on sl7 if LD_LIBRARY_PATH is set
If you've setup any ups products that set LD_LIBRARY_PATH, the /usr/bin/python -SE gets confused and cannot find its libraries on SL7.
This means that the #! /usr/bin/python -SE line at the top of the samweb script fails.
Is there some reason we can't just make it #!/usr/bin/env python or #!/usr/bin/env python2
#4 Updated by Marc Mengel over 3 years ago
So /usr/bin/python has no rpath, so it depends on LD_LIBRARY_PATH to
find libpython2.7.so.1.0. It didn't trigger on SLF6 because
/usr/bin/python is looking for libpython2.6.so.1.0, which is not
overridden by our setup of python v2_7_13d.
#5 Updated by Marc Mengel over 3 years ago
So basically it's confused on SLF7 becuase the system python is python 2.7, and the python being setup by the various experiment environments is also a python 2.7, and it finds their python2.7.so.1.0 rather than the system one, and then it can't seem to find its brains.
However, I think samweb runs fine in various pythons that we would be setting up, so having it run with #!/usr/bin/env python ought to work(?).
#6 Updated by Robert Illingworth over 3 years ago
I've had painful experience in the past with things breaking because of weird stuff in the environment. So this is intended to work with whatever broken combinations of PYTHONPATH, PYTHONHOME, etc that people come up with. I suppose this is just a new variation. But I certainly don't trust that '/usr/bin/env python' will necessarily work correctly.
#8 Updated by Robert Illingworth over 3 years ago
I've just pushed an update that should make this work.
As a bonus, there's now a samweb.py script - if you run samweb you get /usr/bin/python2 with a cleaned environment; if you run samweb.py it'll run with "/usr/bin/env python2" so you'll get anything you might have configured locally.