Openshift中的set-env PATH [英] set-env PATH in Openshift
问题描述
我正在使用pre_start操作挂钩向PATH和LD_LIBRARY_PATH环境添加一些新路径.
I'm using a pre_start action hook to add some new paths to the PATH and LD_LIBRARY_PATH environment.
在git push之后,我可以看到变量已更新,但是当我ssh到服务器时,添加的变量不可用,经过一番谷歌搜索后发现这是因为这些变量作为子外壳导出了.
after git push I can see that variables are updated, however when I ssh to the server, added variables are not available, after some googling I found out this is happening because these variables are exported as a sub-shell.
openshift文档建议使用set-env命令添加变量,但是在运行它时出现以下错误
openshift documentations suggest to add variables using set-env command, but when run it I get following error
rhc set-env PATH=$OPENSHIFT_DATA_DIR/bin:$PATH" -a srv
Setting environment variable(s) ... PATH cannot be overridden
有人知道我们该如何克服吗?
Does anybody know how we can overcome this?
推荐答案
如果我正确地猜到了您最终要完成的工作,则尝试编写自己的墨盒.最近,我们刚刚添加了一个新的环境变量OPENSHIFT_yourcartname_LD_LIBRARY_PATH_ELEMENT
.您可以使用此环境变量来配置每个盒带的库文件的位置
If I'm guessing correctly at what you're ultimately trying to accomplish, your trying to write your own cartridge. Recently we just added a new environment variable OPENSHIFT_yourcartname_LD_LIBRARY_PATH_ELEMENT
. You can use this environment variable to configure the location of each cartridge's library files
这篇关于Openshift中的set-env PATH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!