Had a weird issue with Ruby script output running under nohup. Basically, there is a serious output delay when writing to a log file or using stdout on nohup.out. You can see the original post here, which was answered on this use case:
stack overflow
It has been suggested that I use something like file_object.sync = true which works, however, I am interested in the specifics of why this happens only when the script is under nohup. I assume that there is a deeper complexity to how nohup buffers its own shell output. That way I can implement a more elegant solution if I have a more detailed output.
Any additional resources are appreciated.
Specifications: Ruby 1.8.7 Linux: looks on CentOS 5.4, 5.6 and Amazon Linux AMI version 2012.03 (a bit similar to CentOS 6.2) Nohup: 8.4
Madmartigan
source share