Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux debian init.d脚本在重新启动后未运行_Linux_Debian_Init.d - Fatal编程技术网

Linux debian init.d脚本在重新启动后未运行

Linux debian init.d脚本在重新启动后未运行,linux,debian,init.d,Linux,Debian,Init.d,我需要在系统启动(Linux Debian)后启动我的Wildfly AS-through.sh脚本。所以我创建了自己的脚本,应该在init.d中完成: #! /bin/sh # /etc/init.d/starter case "$1" in start) echo "Starting" nohup /home/xxx/wildfly-9.0.1.Final/bin/standalone.sh & ;; stop) echo "Stopping

我需要在系统启动(Linux Debian)后启动我的Wildfly AS-through.sh脚本。所以我创建了自己的脚本,应该在init.d中完成:

#! /bin/sh
# /etc/init.d/starter

case "$1" in
  start)
    echo "Starting"
    nohup /home/xxx/wildfly-9.0.1.Final/bin/standalone.sh &
    ;;
  stop)
    echo "Stopping"
    /home/xxx/wildfly-9.0.1.Final/bin/jboss-cli.sh --connect command=:shutdown
    ;;
  *)
    echo "Usage: /etc/init.d/starter {start|stop}"
    exit 1
    ;;
esac
exit 0
如果我自己使用它,会起作用:
/etc/init.d/starter start

然后我使用命令创建符号链接:
更新rc.d启动器默认值
。符号链接按预期创建,但是在
重新启动
命令后,脚本不会执行


有人知道是什么阻止我的脚本在引导后执行吗?谢谢您的建议。

问题是我不知道初始脚本必须设置自己的$PATH和其他变量。当我在/var/log/daemon中看到java:notfound时发现了它。最后,我发现wildfly有自己的scirptinit debian.sh。我使用了它,它可以工作。

哪个版本的Debian?DebianV6或更高版本将更新rc.d替换为inserve。。。请参阅Debian Wiki[使用基于依赖关系的引导时如何添加服务]()@agc感谢您的回复。我正在运行8.3。在man InServ中,我读到:“除非您确切知道自己在做什么,否则不建议直接执行InServ,这样做可能会导致启动系统无法运行。更新rc.d是管理init脚本的推荐接口。”因此,这不是问题所在。抱歉,我错过了这一点。嗯,也许吧。这个:find/etc/rc?.d/-name'starter'-execls-l'{}'\;的输出中有什么不寻常的地方吗;ls-l/etc/init.d/starter通常,每个链接都应该由*root所有,并且是文件模式“lrwxrwx(0777)”,文件本身具有模式“-rwxrwxr-x(0775)”。