gen*_*sis 5 linux startup debian
我的 rc.local 中有以下几行
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
if [ -f /resize ]
then
if [ -f /resize2 ]
then
sh /resize2
else
sh /resize
fi
fi
/etc/rc --foreground
/sbin/iptables-restore /etc/iptables
mkdir /tmp/cooks
mkdir /tmp/cook
chmod 777 /tmp/cook
chmod 777 /tmp/cooks
mkdir /tmp/xhprof
chmod 777 /tmp/xhprof
exit 0
Run Code Online (Sandbox Code Playgroud)
但既不/tmp/cooks也没有/tmp/cook,也没有/tmp/xhprof目录没有创建(在系统启动时)。我正在使用Debian GNU/Linux 6.0 squeeze (VPS)
脚本以#!/bin/sh -e. 该-e选项意味着如果任何命令返回非零状态,shell 将退出。很可能其中一个命令失败了。也许/resize或/resize2正在返回非零值,或者可能/etc/rc是,或iptables-restore。将shebang行更改为#!/bin/sh -ex并运行脚本;你会看到它执行的命令的痕迹。
如果您发现其中一个命令在应该成功时返回非零值,请修复它。如果您发现其中一个命令合法地返回非零值,请在|| true其后添加。如果您发现您不关心任何命令的返回状态,请删除-e.
| 归档时间: |
|
| 查看次数: |
5419 次 |
| 最近记录: |