Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [disown]

In the Unix shells bash and zsh, the disown builtin command is used to remove jobs from the job table, or to mark jobs so that a SIGHUP signal is not sent to them if the parent shell receives it (e.g. if the user logs out).

0
votes
0answers
10 views

Prevent SIGINT from reaching mspdebug [duplicate]

For some debugging, I run mspdebug to create a gdb server and then start gdb, connect to mspdebug and start debugging. A normal part of using gdb is hitting CTRL+C, this interrupts the program flow ...
-2
votes
1answer
50 views

Why does `disown -h` make chromium-browser survive closing its terminal emulator tab?

In Why is chromium-browser killed when I close the terminal despite nohup?, I wrote that in a Terminal emulator tab, I ran $ nohup chromium-browser & When I close the terminal tab, chromium-...
16
votes
2answers
1k views

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 ...
1
vote
2answers
1k views

How to disown a process from another shell

To avoid a process to stop when exiting the shell, you can launch the command via nohup or screen It is also possible to disown an existing process with following commands mycommand CTRL-Z bg disown %...
0
votes
4answers
457 views

Disowning child from parent process

If $PID_PARENT launched $PID_CHILD, how can I detach (disown?) $PID_CHILD from $PID_PARENT so that, when I kill $PID_PARENT, $PID_CHILD keeps running like nothing happened? Concretely, my $PID_PARENT ...
1
vote
1answer
233 views

In bash, a process group is a job if and only if …?

Here are two cases when a process group in an interactive shell isn't a job of the shell: $ sleep 100 & [1] 16081 $ jobs [1]+ Running sleep 100 & $ disown %1 $ jobs $ and $ ...
1
vote
1answer
352 views

How do I kill a process created with disown?

I wanted to keep a program, redshift, running in the background instead of having to keep a terminal constantly opened. I learned from a forum that I can do this by typing $ redshift & followed ...
4
votes
1answer
367 views

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 ...
0
votes
1answer
316 views

Why do I still receive stdout or stderr after disowning a process?

I started QEMU and immediately disowned it, but still receive output onto my shell: aburk@aburk:~$ su Password: [root@aburk aburk]# QEMU_AUDIO_DRV="pa" QEMU_PA_SERVER="/run/user/1000/pulse/native" ...
0
votes
1answer
42 views

Terminal that is set to close .. takes the disowned gui_app with itself

a new terminal opens up and runs the script. terminal -e "/script" script runs a gui_app, disowns it. sleeps 4 seconds. #!/bin/sh /gui_app & disown sleep 4 after sleep.. terminal ...
0
votes
1answer
50 views

disown : unable to stop stderr s [duplicate]

Problem: Even with dev null and disown.. web browser is still reporting errors to the terminal it launched from of. web_browser < /dev/null > /dev/null 1>&2 & disown
0
votes
1answer
42 views

“ web_browser & disown ” : still see-ing data

terminal, run web browser: web_browser & disown web browser opens fine. it seems to be disowned by the terminal. but as I use the web browser... to surf the web.. I begin to see the web ...
2
votes
1answer
120 views

What is the behavior of a disowned process over SSH writing to stdout when the SSH session is lost?

I have an application which processes HTTP requests, and it prints out certain information about the request as it processes it to stdout. In this scenario, I have run disown -h and disown on the ...
2
votes
1answer
718 views

Disowned command with redirected STDOUT/STDERR still sending output to shell [closed]

I defined a function in my .bashrc that allows me to open e.g. pdf files from bash by running copen myfile.pdf: function copen { if [[ $# -eq 1 ]] ; then xdg-open "$1" > /dev/null 2>...
2
votes
1answer
393 views

Child process continues to run if parent dies

I have a bash script which is executed via the GUI (lightdm). In some line during the script, I want it to: sudo service lightdm stop - stop the GUI Take over a TTY (like tty1 or tty7) using e.g.: ...
3
votes
1answer
137 views

Clarification for Bash documentation on disown builtin option -h

According to the documentation: To prevent the shell from sending the SIGHUP signal to a particular job, it should be removed from the jobs table with the disown builtin or marked to not ...
2
votes
0answers
314 views

Any caveats to using bash disown from a shell script as an alternative to screen?

I have a process which starts and outputs to a log file. The script which starts it launches it in a GNU screen and then follows the log with tail. The process will immediately begin writing to the ...
2
votes
2answers
2k views

automatically disown application when running it from a terminal

How do you automatically disown an application after you have started it from a terminal? For example: if you start a terminal and run firefox the application will start, but when you then close the ...
3
votes
1answer
2k views

Stealing and reattaching a running process [duplicate]

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 ...
1
vote
1answer
412 views

How to recover a process GUI after broken pipe

I started a process with GUI from the command line in a remote computer using ssh -X. Knowing it would take a long time to run it, I left it in the background and disowned. As I feared, I had ...
13
votes
4answers
20k views

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, ...
0
votes
0answers
197 views

Ways to make a process survive its parent shell's exiting?

In order for a process to survive its parent shell's exiting, what necessary and sufficient conditions does the process need to meet? Specifically considering signals, what signals should be ...
1
vote
2answers
94 views

Does a disowned process receive signals other than SIGHUP?

Is it correct that a shell can send signals only to its jobs, but can't send signals to processes which are not its jobs? disown moves a job out of the job list of a shell. Does that mean a disowned ...
4
votes
1answer
250 views

Why the kernel kills my process with disown when I logout?

I would like to understand the behavior of a process running with disown when a SIGHUP (or similar) from a shell logout occurs. The process simply does the following: sleep 15 seconds print "hello"; ...
4
votes
1answer
450 views

Is there an overlap in the uses of PID and jobspec in Bash?

Is there an overlap in the uses of PID and jobspec in Bash? In my script I store the PID of a command in a variable using $!. Then I call disown with the PID to remove the job from the shell's active ...
0
votes
1answer
83 views

Cannot disown mplayer?

mplayer -vo null -ao alsa test.mp3 & disown It returns sh: 1 : disown: not find Why it doesn't work?
7
votes
2answers
1k views

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 ...
7
votes
1answer
548 views

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 ...
13
votes
2answers
7k views

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 ...
1
vote
1answer
98 views

Prognosis for disowned X11 program. Can I un-disown it?

I have a disowned X11 program, running under my user account. I started it during an SSH session that was disconnected due to a network problem. I'd like to continue working with it, if possible. Can ...
5
votes
3answers
2k views

How to completely detach a process

I want to spawn a process and run it at the top level so that when the shell exits, the process keeps running. I had mistakenly thought that nohup would do this, but when I exit from the shell (the ...
5
votes
0answers
4k views

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 ...
2
votes
2answers
532 views

Is it necessary to disown a process for it to continue running after disconnecting?

Would someone explain if & why disown is necessary if you wish to keep a job running even after you disconnect. I ask because every site I have visited says to use disown and bg but bg on its own ...
6
votes
1answer
2k views

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 ...
2
votes
2answers
2k views

One-liner to execute a process in a current directory with no output and disown it?

I'm trying to do something fairly simple: $ ( cd /opt/myprogram && ./myprocess.sh >/dev/null 2>&1 & ; disown $! ) -bash: syntax error near unexpected token `;' How can I bust ...
5
votes
2answers
3k views

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 ...
4
votes
3answers
951 views

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 ...
6
votes
3answers
743 views

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 ...
23
votes
4answers
9k views

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 ...
3
votes
4answers
1k views

How can I turn the behavior of `gedit something & disown` into the default behavior when calling gedit from the command line?

When I gedit files from the command line, it's always locking the terminal, and I'm tired of explicitly commanding a detached process for it. I tried to alias gedit as something like gedit $* & ...
156
votes
9answers
104k views

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, ...
527
votes
3answers
210k views

Difference between nohup, disown and &

What are the differences between $ nohup foo and $ foo & and $ foo & $ disown