我的脚本(位于/etc/init.d)正在创建一个 pid 文件($PIDFILE),但是没有进程在运行。我的守护程序脚本包括:
start-stop-daemon --start --quiet --pidfile $PIDFILE -m -b --startas $DAEMON --test > /dev/null || return 1
脚本在手动执行时工作正常。
最佳答案
您需要create startup links .
sudo update-rc.d SCRIPT_NAME defaults
然后重启。 SCRIPT_NAME
是/etc/init.d
中脚本的名字(不带路径)
关于linux - 使用 start-stop-daemon 启动时脚本不启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20272771/