Hacker News new | ask | show | jobs
by tasuki 731 days ago
Does nohup allow attaching back to the session? That seems to be the primary use case of shpool.
2 comments

No, 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.
Or use GDB to change stdin/stdout of the nohup'd process to the current shell!
Probably!
lol!
Nohup 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.
nohub 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.

The 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/no... / https://en.wikipedia.org/wiki/Nohup