I want to run a python script on a remote machine, this Python script requires a library to be loaded to run, I pass this LD_PRELOAD variable but it has no effect. What is the most python way to do this?
subprocess.check_output(['ssh', '<SERVER>',' python <SCRIPT> ' , ' > test.log ' , ' & echo -ne $! '], env={'LD_PRELOAD': <LD_PRELOAD_PATH>]})
With check_output I desire to launch the script on the remote machine as a background process while returning the pid to the host machine. Please note I do not want to block on the host machine.
On the remote machine I see following error
INTEL MKL ERROR: /opt/intel/mkl/lib/intel64/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.
Which happens when the library is not loaded. It works fine when I directly launch the script on the remote machine because the env variables(LD_PRELOAD) are sourced from my bashrc.
Thanks
question from:
https://stackoverflow.com/questions/65884137/subprocess-check-output-ssh-env-not-loaded 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…