简体   繁体   English

从Azure上的进程运行时,Linux set -x

[英]Linux set -x when run from a process on Azure

I have bash script which sets the environment and runs a java process. 我有bash脚本,可以设置环境并运行Java进程。 The script calls "set -x". 该脚本称为“ set -x”。 I have an init.d service which runs a guard java program which does all kinds of guarding tasks including identifying that the process is dead and running the shel that starts it. 我有一个init.d服务,该服务运行一个警卫java程序,该程序执行各种警卫任务,包括识别该进程已死并运行启动它的存储架。 On AWS it works perfect. 在AWS上,它运行完美。 I moved to azure and the bash script works perfect when run from command line, but doesn't work when run from the guarding java process. 我移到了azure,bash脚本从命令行运行时效果理想,但是从守卫的Java进程运行时却不起作用。 taking down the "set -x" solved it and now it runs also on azure. 删除“ set -x”解决了它,现在它也可以在azure上运行。 Any idea what can cause the issue? 知道是什么原因引起的吗? Thanks, Nir 谢谢,尼尔

What is the OS version you are using on Azure. 您在Azure上使用的操作系统版本是什么。 We are not able to reproduce the issue. 我们无法重现该问题。 We also ran a init.d service which runs a sample java program which in turn invokes a shell script which has set -x inside it. 我们还运行了一个init.d服务,该服务运行一个示例Java程序,该程序反过来调用其中设置了-x的shell脚本。

Is set -x important for you to run your script?, because all it does is provide a verbose of each statement that is being executed in your script. 设置-x对您运行脚本很重要吗?因为它所做的只是提供正在脚本中执行的每个语句的详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM