为什么找不到我的 PATH 中的这个命令?

为什么找不到我的 PATH 中的这个命令?

我正在尝试从我的 Mythbuntu 计算机上的 MythTV 界面运行命令。

它无法运行,我在我的 mythbackend.log 中发现了这个错误:

Jul 19 15:55:47 mythbuntu mythbackend[1863]: W SystemEvent mythsystemevent.cpp:55 (run) MythSystemEventHandler: Command '/bin/sh /home/mythbuntu/Buttons/powerbutton.sh' returned 127

我在 Google 上查找了它的returned 127含义,它似乎只是意味着“未找到命令”。

但是,/bin在我的路上......

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/mythbuntu/Buttons:/home/mythbuntu

... 而且 sh 肯定在里面:

$ ls /bin/sh
/bin/sh

那么为什么找不到这个命令呢?

答案1

MythTV 后端无法访问 X,因此如果不先正确设置环境,它将无法运行 xset 之类的程序。说明这里用于通过 irexec 运行的脚本重新启动前端,但它应该足够容易遵循并在其中插入 poweroff 脚本。

相关内容