2

If I were to forget to run nohup as described Keep SSH Sessions running after disconnection, would it be possible to keep a process alive after executing it. For example, I am running python program.py for the last 3 hours and forget to run the initial nohup command, could that process stay alive, or would I have to take the hit and start again?

  • so you mean in case you didn't start a tmux or screen session or the nohup command? – hyph Mar 08 '17 at 23:32
  • Yep. Would there be a way keep a running process alive :) – quasipolynomial Mar 08 '17 at 23:33
  • 1
    @mods while searching for duplicate (there's not really one here on unix SE, I accidentally clicked on something. Was mistake. I found this on superuser: http://superuser.com/a/96664/703934. Read the answer about the disown command. Even in your link there's one answer which talks about the disown command. That should be what you're looking for. – hyph Mar 08 '17 at 23:35
  • The accepted answer doesn't cover this case, but do scroll down a bit. Another high-scoring answer mentions disown. – Gilles 'SO- stop being evil' Mar 08 '17 at 23:48
  • I am voting to reopen the question: It is about applying nohup (or similar) AFTER a process was already initiated. This superuser answer uses disown -h. This method IMHO could be explained in more detail here, too. – FelixJN Mar 04 '21 at 13:51

0 Answers0