我正试图围绕 s6 主管套件。我已经想出了运行和日志,但我被 s6-envdir 困住了,我不确定如何使用它。
我看到环境变量已设置,但我无法访问它。
为了显示:
# According to the docs, set a variable
cat /local/s6/services/ping_stdout/env/PING_HOST
ya.ru
# Make sure there's no such variable in my current env
env | grep PING_HOST
echo $?
1
# Make sure it gets exported if I use s6-envdir
s6-envdir /local/s6/services/ping_stdout/env env | grep PING_HOST
PING_HOST=ya.ru
# Now try to get it printed
s6-envdir /local/s6/services/ping_stdout/env echo "=== ${PING_HOST} ==="
=== ===
它没有被使用,但如果我尝试使用我的环境中已经存在的东西,没问题:
s6-envdir /local/s6/services/ping_stdout/env echo "=== ${ZSH} ==="
=== /home/hoodoo/.oh-my-zsh ===
我是不是搞错了什么?
如何使用 s6-envdir 设置的变量?