Questions tagged [disown]

Question related to the "disown" builtin command from shells like bash, zsh or ksh.

Use the tag for question related to the non-standard "disown" builtin from some advanced shells like bash, zsh or ksh, to which (just like to its friend) marvelous properties well beyond its capabilities are assigned by the common Unix folklore.

57 questions
772
votes
5 answers

Difference between nohup, disown and &

What are the differences between $ nohup foo and $ foo & and $ foo & $ disown
Lesmana
  • 26,889
  • 20
  • 81
  • 86
191
votes
9 answers

How can I disown a running process and associate it to a new screen shell?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there. Is there a…
levesque
  • 3,775
  • 5
  • 20
  • 15
38
votes
6 answers

How can I detach a process from a bash script?

I am trying to detach a process from a bash script so that SIGINT will not be forwarded to the process when I exit the script. I have used the disown command in terminal directly, however in bash, disown does not stop SIGINT from being forwarded.…
user2328113
  • 539
  • 1
  • 5
  • 7
28
votes
4 answers

What happens to the output of a process that has been disowned and lost its terminal?

If I close the virtual terminal, where some process was started, does the output just go straight to /dev/null, or can it pollute memory somehow? Can I anyhow grab the output to continue reading it at any point after that? [EDIT]: So, is the moment…
rozcietrzewiacz
  • 38,754
  • 9
  • 94
  • 102
24
votes
2 answers

Do `disown -h` and `nohup` work effectively the same?

disown causes a shell not to send SIGHUP to its disowned job when the shell terminates, and removes the disowned job from the shell's job control. Is the first the result of the second? In other words, if a process started from a shell is…
Tim
  • 98,580
  • 191
  • 570
  • 977
19
votes
1 answer

Change the parent process of a process?

Is it possible to change the parent process of a process? If yes, how? For example, how does screen manage to attach a screen session and the processes running inside it to different shell processes? Is there change of parent process? I seem to…
Tim
  • 98,580
  • 191
  • 570
  • 977
12
votes
1 answer

Detach a process from Sh (not Bash) or “disown” for Sh (not Bash)

Consider a shell script executed by Sh, not Bash (and I can't change it, and can't use a shebang, it's ignored). The & operator works, but disown $! does not and makes Sh complains “disown: not found”. How do I detach a background process from…
Hibou57
  • 845
  • 2
  • 9
  • 20
9
votes
3 answers

In zsh, how can I more quickly disown the foreground process?

My method for disowning the foreground process takes too much effort. Suppose I have a process in zsh's foreground. I want to disown it, so I can close the shell without the process being sent a SIGHUP. At the moment, I start with Ctrl+z to…
8
votes
1 answer

Stealing and reattaching a running process

It's sunday and I left an instance of R running in the office. The script finished running, and I would like to save my workspace without going to the office. I can ssh to the computer, but I have not run the program into screen. Is there a way,…
Three Diag
  • 497
  • 4
  • 15
7
votes
2 answers

Disown won't take -h option

I'm running a command that I now realize I'd like to leave running after I close my SSH session. I didn't start it with a & argument, but I have put it in the background (CTRL-z, bg). Now I'm trying to make it keep going after I disconnect. …
Coderer
  • 249
  • 3
  • 9
7
votes
1 answer

Is it possible to add a process to the job list in bash (e.g. to reverse "disown")?

If I disown a job in bash and change my mind, can I undo it somehow ? If so, taking it further, is it possible to bring an arbitrary process under job control (an acceptable restriction would be that I own the process) ? And, finally, would this…
starfry
  • 7,302
  • 6
  • 47
  • 69
6
votes
1 answer

A script's background process is still alive after closing the terminal

This is more of a process management/signal handling question than a Bash question. It just uses Bash to explain the issue. I'm running a Bash script in which I run a background process. This is the script: #!/bin/bash # ... # The background…
Rany Albeg Wein
  • 670
  • 4
  • 14
6
votes
3 answers

firefox process dies after ssh log out on remote machine

I need to run firefox on a remote host via ssh and keep process running even after ssh logout. I already have tried these ways: nohup firefox & screen disown -h But it seems these work only for the process without an X11 display, because these work…
4
votes
1 answer

How to open the gnome-terminal within the gnome-terminal without disowning

If I open the gnome-terminal within the gnome-terminal, the newly created terminal automatically gets disowned from the parent. Some other applications do not. How to simulate that behavior? How to not disown the new created terminal? Thanks for…
4
votes
3 answers

Why do 'nohup' and 'disown' not work on SoX (invoked as 'play')

I can run this command: $ play mylist.m3u And music plays. I can then press Ctrl-Z to suspend the job, and issue bg to have it run in the background. However, if I then run disown and exit, the music stops playing, even though the play command…
jwd
  • 1,282
  • 8
  • 12
1
2 3 4