Skip to content

Instantly share code, notes, and snippets.

@bpo
Created November 21, 2010 22:17
Show Gist options
  • Save bpo/709210 to your computer and use it in GitHub Desktop.
Save bpo/709210 to your computer and use it in GitHub Desktop.
detaching from tty?
vagrant@vagrantup:~$ cat test.sh
#! /bin/bash
sleep 20
vagrant@vagrantup:~$ ./test.sh &
[1] 10488
vagrant@vagrantup:~$ disown 10488
vagrant@vagrantup:~$ ps -a
PID TTY TIME CMD
10488 pts/0 00:00:00 test.sh
10489 pts/0 00:00:00 sleep
10494 pts/0 00:00:00 ps
@bpo
Copy link
Author

bpo commented Nov 21, 2010

how do you actually get the process to no longer have a controlling tty? disown and nohup don't do what I want here.

@marksands
Copy link

:~$ nohup ./test.sh & is typically what I do. I think it works too :)

@bpo
Copy link
Author

bpo commented Nov 22, 2010

nope. nohup doesn't actually disassociate the tty in ps -a's output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment