0

is it possible to alter some setting in CentOS so that nohup isn't necessary? i.e. so that my scripts won't be killed when I log off?

I think that the automatic output of text to nohup.out is mangling the output of a parallel job, i.e. output from multiple threads is getting mixed together, making the script useless.

On Ubuntu, this is the default behavior.

con
  • 109
  • Have you considered running your job in a terminal multiplexer, such as tmux or GNU screen? – Kusalananda Dec 16 '19 at 17:14
  • You don't have to use nohup.out. You can redirect the output to a different file: nohup cmd > FILE. – NickD Dec 16 '19 at 17:40
  • Can you explain clearly, what you want and what you have tried. You seem to have a problem (though I don't know what it is. Is it mixing outputs?), with the outputs, when you use nohup. Is this correct? – ctrl-alt-delor Dec 16 '19 at 17:44
  • I suspect, NickD, that the part that the questioner isn't telling us is that it's the redirection to file, any file, that is the problem. The "mangling" may well be the consequence of standard output buffering, or non-tty detection. Of course, that would be far better asked as How do I get my program(s) to print output less confusingly when redirected to file? Like https://unix.stackexchange.com/q/249723/5132 in fact. (-: – JdeBP Dec 16 '19 at 17:44
  • @JdeBP that's not what's happening. Output from multiple threads is getting mixed together into nohup.out, which is making a confusing mess between the threads. – con Dec 16 '19 at 17:57
  • So, are there two very separate questions here? One is about having a job with several processes running while you log off, and another is about not having the output from those processes "mangled" (interleaved)? I'm sure there are separate duplicates for both of those questions on this site, but since you have asked both in one question it would be difficult to choose which one to go for. – Kusalananda Dec 16 '19 at 18:02

0 Answers0