我的实际问题是试图debugging一个init脚本来启动Resque。 它工作正常,从命令行以root身份运行,但在启动时不做任何事情。 它有一些适当的insserv头文件,我运行updaterc.d来创build符号链接,并检查它们是否存在。 脚本是+ x。
# find /etc/rc*.d -name \*resque\* /etc/rc0.d/K01resque /etc/rc1.d/K01resque /etc/rc2.d/S01resque /etc/rc3.d/S01resque /etc/rc4.d/S01resque /etc/rc5.d/S01resque /etc/rc6.d/K01resque # ls -l /etc/init.d/resque -rwxr-xr-x 1 root root 2093 Oct 24 03:02 /etc/init.d/resque
脚本可以在这里查看,如果你喜欢。 它使用lsb函数来logging消息,本质上echo()我相信STDOUT。 那么在启动过程中输出到哪里? 它不在/ var / log / *日志中
initscripts的输出不logging在任何地方,任何输出到控制台。 要logging脚本的输出,请在顶部添加以下内容:
exec 1>/tmp/init.log 2>&1
你也可能想要添加set -x来看看它是如何被解释的。
在Debian Wheezy上,做
apt-get install bootlogd
在以前的版本中,它已经安装,但是您需要在/etc/default/bootlogd启用它。
然后输出logging到/var/log/boot