无法从rc.local中的脚本调用脚本

时间:2018-09-17 07:44:59

标签: linux ubuntu rc

我正在从rc.local运行脚本,我们称它为script_1.sh

此外,script_1.sh运行script_2.sh,但是这个从未运行! 不可能从另一个脚本(从rc.local运行的脚本中调用一个脚本吗?

/etc/rc.local

#!/bin/sh -e
cd /path/folder1
./script_1.sh > output.log

exit 0

脚本1

echo "running script 1"
cd /path/folder2
./script_2.sh
echo "done with script 1"

echo "all done!"

脚本2

echo "Running script 2"

输出:

running script 1
done with script 1
all done!

如果我手动运行脚本,则脚本可以运行,但是如果脚本在重新启动后运行,则脚本2无法运行。.

0 个答案:

没有答案
相关问题