On Friday 20 June 2008 03:41, Matt Archer wrote:
Randall R Schulz wrote:
On Thursday 19 June 2008 10:06, jdd wrote:
hello, I have a hosted server and I would use it to seed 11 torrent. I already have all what I need (iso, torrent, btXX), but I don't know how to start (and what incarnation of bt to start) to have it stay running when I close the ssh link
idea? (& is not enough)
Check out the "nohup" command. It's for precisely this purpose.
typical usage:
$ nohup some_commmand_here arg1 arg2 arg3 &
& runs the command asynchronously (i.e. it puts the process "in the background", so you can do other things).
Nohup inserts a signal-catcher so that if the "HUP" signal (for "Hang-UP" -- think back to the days of modems and dial-up, even for command line logins) -- which a login shell issues to every child process just as it exits.
Just for the sake of accuracy, it' is the terminal driver that generates SIGHUP. In the classic case of serial modems, it is triggered by and reflects literally the fact that a modem was hung up. The same would happen if a serial line were physically disconnected or the equipment (terminal) at the other end was powered off. In the modern case, where almost every terminal is a "pseudo tty," with processes on opposite sides (called master and slave) of the driver, it is the fact no process holds the master side open any longer that triggers the generation of SIGHUP.
Nohup intercepts this "HUP" signals, and allows the program to keep on running.
Again, for the sake of accuracy, the "nohup" command sets the handling for SIGHUP to ignored and then runs the command specified in its arguments, which inherits this "ignored" status. In particular, signals can only be caught by the program to which they're delivered, though if a signal causes a program's death, its parent can tell, via the exit status it receives, whether a signal caused the death and if so which signal it was. Also note that if you have not redirected output descriptors that would ordinarily go to the (pseudo-) tty, nohup will redirect them to a file called "nohup.out" for you. Lastly, some programs, usually servers such as Apache, will catch SIGHUP and when they receive it they reload their configuration files. Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org