1
vote
1answer
57 views

service killed at ssh hangup [duplicate]

If I use ssh to run some command in background, that command gets killed as soon an ssh hangs up: ssh localhost -t "bash -c '(for i in 1 2 3 4 5; do sleep \$i;done)&'"; ps x|grep sleep This ...
2
votes
1answer
755 views

starting server with nohup and redirecting input, output

I have a init.d script that starts a python socket server. Because I want this to run as a daemon, I use nohup to start it. I also want to redirect stdout and stderr to a log file. My problem is ...
4
votes
2answers
2k views

Is it possible for nohup to write the output both to the file nohup.out AND to the screen/terminal?

I am using the bash shell. I frequently use nohup to ensure that my processes are not stopped when I close the shell/terminal that started them. I use a syntax like: nohup myprocess When ...
1
vote
2answers
2k views

How to make a program which run from shell still live after close terminal? [duplicate]

Possible Duplicate: How do I prevent a script from terminating when the shell exits? I use gnome-terminal, and I run emacs under the terminal in the background by executing emacs &, but ...
3
votes
2answers
353 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 ...
5
votes
3answers
1k views

Why `> my.log 2>&1 &` causes the job to sustain log out?

I use myscript > my.log 2>&1 & to run a script and collect it's output - so that when I logout - the script will still be running. It I were to start it with myscript & - it will ...
6
votes
3answers
953 views

Why are background jobs started by my shell living longer than the parent shell and controlling terminals?

It is commonly said that "&" puts the process into background execution, but that process would be killed when terminal is closed. But from what I see, everything I sent into background was ...
4
votes
3answers
4k views

How to totally fork a shell command that is using redirection

I've written quite a few shell scripts over the years (but I'm certainly not a sysadmin) and there's something that always caused me troubles: how can I fork a shell command immune to hangups in the ...
2
votes
4answers
2k views

How to limit the number of lines a command's output has available in bash?

I started downloading a big file in the background using $ nohup wget http://example.tld/big.iso & which also gives me a nohup.out file that includes the output of wget. Now, if I later want ...
105
votes
1answer
19k views

Difference between nohup, disown and &

What is the difference between $ nohup foo and $ foo & and $ foo & $ disown