没有带有尾部的日志内容,但是当终止进程时,我看到内容较少

时间:2022-03-20 00:11:45

Basically, I am running:

基本上,我正在运行:

nohup ./executable &> /tmp/out.log &

In order to make sure the process is running I ran the command:

为了确保进程正在运行,我运行了命令:

tail -f /tmp/out.log

But the only thing I can get from tail is "nohup: ignoring input", and once killing the process that previously started I can see the contents of out.log

但我唯一可以从尾巴获得的是“nohup:忽略输入”,一旦杀死之前开始的进程,我可以看到out.log的内容

2 个解决方案

#1


5  

Run your program as:

运行您的程序:

nohup stdbuf -oL ./executable &> /tmp/out.log &

stdbuf can change the default buffering.

stdbuf可以更改默认缓冲。

#2


4  

Your executable is using buffered output, so you will only see something with tail if more than one block of output is produced. The size of such a block will be 4k or more.

您的可执行文件使用缓冲输出,因此如果生成多个输出块,您将只看到带尾部的内容。这种块的大小将是4k或更多。

If you wrote the executable yourself, change the output to line buffered or to not buffered.

如果您自己编写了可执行文件,请将输出更改为行缓冲或未缓冲。

#1


5  

Run your program as:

运行您的程序:

nohup stdbuf -oL ./executable &> /tmp/out.log &

stdbuf can change the default buffering.

stdbuf可以更改默认缓冲。

#2


4  

Your executable is using buffered output, so you will only see something with tail if more than one block of output is produced. The size of such a block will be 4k or more.

您的可执行文件使用缓冲输出,因此如果生成多个输出块,您将只看到带尾部的内容。这种块的大小将是4k或更多。

If you wrote the executable yourself, change the output to line buffered or to not buffered.

如果您自己编写了可执行文件,请将输出更改为行缓冲或未缓冲。