在我的 SBT (0.13.16) 版本中,我有以下任务:
startThing := {
var bin_path = s"${file(".").getAbsolutePath}/bin"
val result = s"$bin_path/start_thing".!
if (result != 0)
throw new RuntimeException("Could not start Thing..")
true
}
And start_thing
包含:
(run_subprocess &)
我的构建挂起。
我理解了start_thing
退出(进程表没有它作为条目)但添加一些println
任务显示它被卡住了val result = s"$bin_path/start_thing".!
.
如果我杀了run_subprocess
然后SBT解除阻塞并正常运行。
在这种特殊情况下,run_subprocess
已经设置了一些 Kubernetes 端口转发,以便后续测试能够正常工作。
Try 守护进程 http://linuxg.net/how-to-transform-a-process-into-a-daemon-in-linux-unix/后台进程就像这样
(run_subprocess >/dev/null 2>&1 &)
该问题可能是从输出run_subprocess
仍然按照建议去 sbt 家长here https://stackoverflow.com/questions/21141352/python-subprocess-calling-a-script-which-runs-a-background-process-hanging#answer-21142569.
我能够在 sbt 0.13.17 和 1.0.2 中复制该问题。守护进程在两者中都起作用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)