代码之家  ›  专栏  ›  技术社区  ›  jiandingzhe

我的system V init脚本不返回

  •  0
  • jiandingzhe  · 技术社区  · 8 年前

    #!/lib/init/init-d-script
    
    DAEMON="/usr/local/bin/myprogram.py"
    NAME="myserviced" 
    DESC="The description of my service"
    

    当我启动服务时(直接调用或调用 sudo service myserviced start ),我可以看到程序 myprogram.py 运行,但它没有返回到命令提示符。

    我想一定有什么我误解了,那是什么?

    该系统是Debian,在Raspberry Pi上运行。

    1 回复  |  直到 8 年前
        1
  •  0
  •   jiandingzhe    8 年前

    经过更多的工作,我终于解决了这个问题。有两个主要原因:

    • init-d-script 实际通话 start-stop-daemon --exec 选项终止脚本时,只应指定 --name 初始化d脚本 始终填充 选项,它不能与脚本守护进程一起使用。我必须自己写sysv脚本。

    • 启动停止守护进程 启动停止守护进程 应该是后台程序本身,但不是常规程序。

    推荐文章