4 ms·
Does nohup allow attaching back to the session? That seems to be the primary use case of shpool.
by tasuki 2y ago
Does nohup allow attaching back to the session? That seems to be the primary use case of shpool.
- eigenvalue 2y agoNo, it doesn't let you attach back, it just keeps a command going after you've disconnected your session. But if you have good logging that might be good enough.
- chaps 2y agoOr use GDB to change stdin/stdout of the nohup'd process to the current shell!
- threePointFive 2y agoNohup still attaches to the terminal's stdin/out/err. If the process is known to be non-interactive, redirecting to log files should be sufficient (tail -f to "reattach"). If it does expect interaction, creating a fifo file to redirect stdin from should work, but I've never tested it.
- rangerelf 2y agonohub doesn't attach nor redirect the stdin/out/err, it intercepts the HUP signal that apps receive when their controlling TTYs are disconnected. Implying "tail -f $LOGFILE" is akin to tmux reattaching to a console is a stretch.
- re 2y agoThe standard Unix version of nohup does in fact redirect the output/error streams if they would otherwise go to a terminal. https://pubs.opengroup.org/onlinepubs/009695299/utilities/nohup.html https://pubs.opengroup.org/onlinepubs/009695299/utilities/no... / https://en.wikipedia.org/wiki/Nohup https://en.wikipedia.org/wiki/Nohup