【问题标题】:Running lein repl :headless in the background在后台运行 lein repl :headless
【发布时间】:2017-06-03 16:03:55
【问题描述】:

目标:在后台运行 lein Headless

我正在尝试无头运行 leiningen REPL,但不使用终端。也就是说,我想做

$ lein repl :headless &

但几秒钟后 bash 报告它已停止

$ [2]+  Stopped                 lein repl :headless

在 zsh 和 sh 中运行这个结果是一样的。这些 shell 打印接收到的信号 SIGTTIN,这意味着该进程试图从 STDIN 读取,尽管它不是终端控制进程。

以下作品:

$ bash -c "lein repl :headless &"
$ lein repl :headless </dev/null &

我查看了repl :headless does not work without stdin,但无法使用那里的内容解决我的问题。


其他一些细节:

放置

#!/bin/bash
lein repl :headless & 

进入脚本test.bash 并运行./test.bash 也可以。但是将行更改为lein repl :headless 并运行./test.bash &amp; 不会。

跑步

$ lein repl :headless &
$ disown %1

也不行; ps 的进程报告它已终止。

我通常也使用reattach-to-user-namespace 运行tmux,但我已经在tmux 内部和外部以及多个终端仿真器(iTerm2 和终端)中进行了尝试。如果有帮助,here are my stty -a settings

【问题讨论】:

    标签: bash clojure signals leiningen


    【解决方案1】:

    lein trampoline repl :headless &amp; 会解决这个问题。

    您可以阅读this 以获得解释。

    【讨论】:

      猜你喜欢
      • 2014-11-28
      • 2016-08-14
      • 2016-02-21
      • 2016-05-15
      • 2017-08-18
      • 1970-01-01
      • 1970-01-01
      • 2015-11-21
      • 1970-01-01
      相关资源
      最近更新 更多