【发布时间】:2017-02-22 09:21:04
【问题描述】:
我有脚本在启动时停止网络管理器。我在 rc.local 中为此做了条目。它工作正常。但是在一台服务器上安装了 MySQL,并且 rc.local 已经有一个用于 start lampp 的条目。 (/opt/lampp/lampp 启动)。
在那之后我为我的脚本做了条目。现在 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.
/opt/lampp/lampp start
sh /etc/startupscript.sh
exit 0
在启动时第一个条目执行并且日志在 boot.log 是:
跳过 /etc/apparmor.d/disable 中的配置文件:usr.sbin.rsyslogd * 启动 AppArmor 配置文件 [确定] 启动 XAMPP for Linux 5.6.24-1... XAMPP:启动 Apache ......好的。 XAMPP:启动 MySQL ......好的。 XAMPP:启动 ProFTPD ......好的。 启动 XAMPP for Linux 5.6.24-1... XAMPP:启动 Apache...失败。 XAMPP:另一个 Web 服务器已经在运行。 XAMPP:正在启动 MySQL...好的。
XAMPP:正在启动 ProFTPD...已经在运行。
然后退出。第二行 sh /etc/startupscript.sh 未执行。
如果我手动执行 rc.local,两个脚本都会成功运行。 提前致谢。
【问题讨论】:
-
你的意思是如果“/opt/lampp/lampp start”行不存在那么startupscript.sh被执行?
-
正确的Prabhu,由于上一个错误而退出。