[英]How do I run a subprocess using local librairies on a remote server using mounted file systems?
I am using a subprocess to run a program on another machine through a mounted network file system. 我正在使用子进程通过已安装的网络文件系统在另一台机器上运行程序。
For my first step in this project I have been using sshfs mount and wget: 对于我在这个项目中的第一步,我一直在使用sshfs mount和wget:
sys_process = subprocess.Popen(wget_exec.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
wget
works perfectly 使用命令: wget
完美运行 /mnt/ssh_mount/wget
does not execute 使用命令: /mnt/ssh_mount/wget
不执行 System libraries: 系统库:
I know this because when I call the wget command through the ssh mount (/mnt/ssh_mount/bin/wget) it throws an error. 我知道这一点,因为当我通过ssh mount(/ mnt / ssh_mount / bin / wget)调用wget命令时,它会抛出一个错误。 I do not wish to install needed libraries to all systems using this as it defeats the purpose of trying to run something remotely. 我不希望使用这个安装所有系统所需的库,因为它无法尝试远程运行某些东西。
For measure checks for permissions have been made 对于权限的度量检查已经进行
How do I get the command to use the local libraries? 如何获取使用本地库的命令?
I hope to use nfs as well which would exclude below as solutions: 我希望也使用nfs,它将在下面排除作为解决方案:
I have tried (with no success) os.chdir('/mnt/ssh_mount')
我试过(没有成功) os.chdir('/mnt/ssh_mount')
Error while loading shared libraries: 'libpcre.so.0: cannot open shared object file: No such file or directory' assumes a stable mount point which would cause changes in 2 places when the environment would change (this seems wrong from a database normalization background, I would assume code/sys admin as well) 加载共享库时出错:'libpcre.so.0:无法打开共享对象文件:没有这样的文件或目录'假设一个稳定的安装点,当环境发生变化时会导致2个位置发生变化(这似乎是数据库规范化的错误)后台,我会假设代码/系统管理员也是)
You are not actually running the wget
command on the remote machine - you are trying to run the remote machine's binary on your local system, and the command is failing due to incompatible library versions. 您实际上并未在远程计算机上运行wget
命令 - 您尝试在本地系统上运行远程计算机的二进制文件,并且由于库版本不兼容而导致命令失败。 sshfs
, nfs
, and other types of network mounting protocols simply mount the remote filesystem as an extension of your local one - they don't allow for remote execution. sshfs
, nfs
和其他类型的网络安装协议只是将远程文件系统挂载为本地扩展 - 它们不允许远程执行。 To do that, you'll need to open a remote shell using ssh
tunneling and execute the Arch wget
command through that. 为此,您需要使用ssh
隧道打开远程shell并通过它执行Arch wget
命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.