标签: nohup

在通过 ssh 执行 nohup 期间按 ctr+c 后会发生什么?

我有一些关于 nohup 的问题。下面显示了我尝试过的命令和结果。如果我必须使用nohup ... &and then disown,那么 the 有什么用呢nohup我可以简单地使用... &然后disown

使用然后 ctr+c 运行命令nohup,该命令没有继续

$ nohup somecommand -option inputfile > outputfile
nohup: ignoring input and appending output to `nohup.out'
^C
Run Code Online (Sandbox Code Playgroud)

运行命令nohup ... &,然后按ctr+c,命令继续但退出后停止

$ nohup somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ exit
Run Code Online (Sandbox Code Playgroud)

运行命令nohup ... &,然后按 ctr+c,即使退出后命令仍会继续

$ nohup somecommand -option inputfile > outputfile & …
Run Code Online (Sandbox Code Playgroud)

unix ssh remote-access nohup

4
推荐指数
1
解决办法
531
查看次数

使用 playframework 执行 nohup 命令会出现错误的文件描述符错误

我使用 playframework2.2 和 sbt 0.13.1,我可以运行 sbt 并在命令行上启动服务器

开始

工作正常。但是当我跑步时:

nohup sbt 启动

它运行了一段时间,然后停止并出现日志错误:

(Starting server. Type Ctrl+D to exit logs, the server will remain in background)  java.io.IOException: Bad file descriptor
at java.io.FileInputStream.read0(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:210)
at jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:248)
at jline.internal.InputStreamReader.read(InputStreamReader.java:261)
at jline.internal.InputStreamReader.read(InputStreamReader.java:198)
at jline.console.ConsoleReader.readCharacter(ConsoleReader.java:2038)
at  play.PlayConsoleInteractionMode$$anonfun$waitForKey$1.play$PlayConsoleInteractionMode$$anonfun$$waitEOF$1(PlayInteractionMode.scala:36)
at play.PlayConsoleInteractionMode$$anonfun$waitForKey$1$$anonfun$apply$1.apply$mcV$sp(PlayInteractionMode.scala:45)
at play.PlayConsoleInteractionMode$$anonfun$doWithoutEcho$1.apply(PlayInteractionMode.scala:52)
at play.PlayConsoleInteractionMode$$anonfun$doWithoutEcho$1.apply(PlayInteractionMode.scala:49)
at play.PlayConsoleInteractionMode$.withConsoleReader(PlayInteractionMode.scala:31)
at play.PlayConsoleInteractionMode$.doWithoutEcho(PlayInteractionMode.scala:49)
at play.PlayConsoleInteractionMode$$anonfun$waitForKey$1.apply(PlayInteractionMode.scala:45)
at play.PlayConsoleInteractionMode$$anonfun$waitForKey$1.apply(PlayInteractionMode.scala:34)
at play.PlayConsoleInteractionMode$.withConsoleReader(PlayInteractionMode.scala:31)
at play.PlayConsoleInteractionMode$.waitForKey(PlayInteractionMode.scala:34)
at play.PlayConsoleInteractionMode$.waitForCancel(PlayInteractionMode.scala:55)
at play.PlayRun$$anonfun$24$$anonfun$apply$9.apply(PlayRun.scala:373)
at play.PlayRun$$anonfun$24$$anonfun$apply$9.apply(PlayRun.scala:352)
at scala.util.Either$RightProjection.map(Either.scala:536)
at play.PlayRun$$anonfun$24.apply(PlayRun.scala:352)
at play.PlayRun$$anonfun$24.apply(PlayRun.scala:334)
at sbt.Command$$anonfun$sbt$Command$$apply1$1$$anonfun$apply$6.apply(Command.scala:72)
at sbt.Command$.process(Command.scala:95)
at …
Run Code Online (Sandbox Code Playgroud)

linux scala nohup playframework playframework-2.2

4
推荐指数
1
解决办法
2684
查看次数

告诉 nohup 实时写入输出

使用时,nohup脚本的输出会被缓冲,并且仅在脚本执行完成后才会转储到日志文件 (nohup.out)。以接近实时的方式查看脚本输出以了解其进展情况将非常有用。有没有办法让nohup脚本生成时写入输出?或者,由于如此频繁的文件访问操作很慢,因此在执行期间定期转储输出?

bash real-time nohup output

4
推荐指数
1
解决办法
3346
查看次数

使用 nohup -> 输出到文件和控制台

我在我的项目中使用 nohup。在使用 nohup 时,是否有可能将程序的输出同时发送到控制台和文件?

使用“tee”我没有成功:

nohup ./programm 2>&1 | tee Output.txt
Run Code Online (Sandbox Code Playgroud)

感谢帮助

linux console nohup output

4
推荐指数
1
解决办法
2万
查看次数

Jupyter如何在后台运行单元格?

通常,如果在单元格运行时网络连接丢失或网络浏览器关闭,我必须从头开始再次运行单元格。

为了解决这个问题,我将 .ipynb 转换为 .py 并使用“nohup python .py”

有什么办法可以像 nohup 一样防止正在运行的单元停止吗?

先感谢您。

python background nohup jupyter

4
推荐指数
2
解决办法
1万
查看次数

有什么方法可以在后台运行进程吗?

有什么命令行或.NET方法在后台运行一个进程,隐藏它试图打开的任何窗口?

已经尝试过:

 var process = new Process()
 {
      StartInfo = new ProcessStartInfo()
      {
          CreateNoWindow = true,
          WindowStyle = ProcessWindowStyle.Hidden,
          FileName = TheRealExecutableFileNameHere
      }
 }
 process.Start();
Run Code Online (Sandbox Code Playgroud)

到目前为止没有成功

.net c# nohup

3
推荐指数
3
解决办法
3万
查看次数

nohup与现在的区别

似乎nohup现在之间没有区别,但也许有微妙之处?

linux scheduling nohup at-job

3
推荐指数
1
解决办法
1347
查看次数

将nohup的输出错误发送到syslog

我正在尝试编写一个使用nohup的bash脚本并将错误传递给rsyslog.

我已尝试使用日志变量的不同变体(见下文),但无法将输出传递给除std txt文件之外的任何内容.我无法得到管道.

nohup imageprocessor.sh > "$LOG" &
Run Code Online (Sandbox Code Playgroud)

是否可以管道nohup输出或我需要一个不同的命令.

我尝试过的几种日志变体

LOG="|/usr/bin/logger -t workspaceworker -p LOCAL5.info &2"
Run Code Online (Sandbox Code Playgroud)

要么

LOG="|logtosyslog.sh"
Run Code Online (Sandbox Code Playgroud)

要么

LOG="logtosyslog.sh"
Run Code Online (Sandbox Code Playgroud)

bash nohup rsyslog

3
推荐指数
1
解决办法
3043
查看次数

忘了使用&after命令后,需要将进程发送到后台

我一直在使用nohup运行一个程序,但我忘了在命令后添加&,因此终端卡在已经运行了几个小时的进程上.我在python中运行的脚本每次都会生成5个进程.

无论如何我可以使整个脚本在后台继续(获得与&相同的效果)而不会杀死并重新运行该过程.

command-line nohup

3
推荐指数
1
解决办法
1031
查看次数

使用nohup调用时,为什么以下bash脚本无法正常工作?

像下面这样的脚本:

#!/bin/bash

function hello {

        echo "Hello World"

}

hello
Run Code Online (Sandbox Code Playgroud)

会工作正常,但当我用nohup称呼它

nohup ./myScript.sh 
Run Code Online (Sandbox Code Playgroud)

该脚本不再有效,并打印以下内容:

./myScript.sh: 5: ./myScript.sh: function: not found
Hello World
./myScript.sh: 9: ./myScript.sh: Syntax error: "}" unexpected
Run Code Online (Sandbox Code Playgroud)

我知道使用nohup这个脚本是没有意义的,因为它运行得相当快,但我有另一个脚本需要几个小时才能运行,我已经在其中使用了该函数语法.有没有办法来解决这个问题?

bash shell nohup

3
推荐指数
1
解决办法
1066
查看次数