Monit 不调用 python 脚本<-->操作系统是CentOS

发布于 2025-01-16 23:57:24 字数 223 浏览 2 评论 0 原文

Monit 不调用 python 脚本<-->操作系统是CentOS。 python 脚本中的第一行是“#!/usr/bin/env python3”,当我尝试从终端调用 python 脚本时,它正在工作,但 monit 无法触发该脚本。

我尝试从 monit 中的 shell 脚本调用 python 脚本,但没有成功。即使我尝试将 PATH 变量添加为 shell 脚本的第二行。 任何帮助将不胜感激。

Monit not invoking python script <--> OS is CentOS. first line in python script is "#!/usr/bin/env python3" when i tried to invoke python script from my terminal its working but monit is not able to trigger the script.

I tried to call python script from shell script in monit but no luck. even i tried adding PATH variable as second line to shell script.
any help will be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉南桥 2025-01-23 23:57:24

问题在于 PATH 环境变量,例如 cron,monit 仅从 PATH 变量获取值的子集而不是所有值。因此,在 shell 解释器之后显式添加 $PATH 变量后,问题得到解决

Issue is with PATH environmental variable, like cron, monit is only taking subset of values from PATH variable instead of all values. So after explictly adding $PATH variable after shell interpreter, issue got resolved

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文