LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Process killed during close ssh session, how prevent such thing (https://www.linuxquestions.org/questions/debian-26/process-killed-during-close-ssh-session-how-prevent-such-thing-4175590959/)

Lenin1 10-07-2016 10:04 AM

Process killed during close ssh session, how prevent such thing
 
I use Debian 8 on ARM V7 system. I run some program that should run for long period of time. I start them from SSH connection ( no other way to do ) . After I close SSH session process I started is killed .
How can I prevent such thing ?
I heard about nohup .How is the best way use it ? Maybe there is other applications that preffered for such things


Thanks

IsaacKuo 10-07-2016 02:05 PM

Here's an example of using nohup:

Code:

nohup /home/isaackuo/mybackgroundscript.sh &
Note that this will open up an output file "nohup.out" that contains the output from the program which you have started. Depending on what the program outputs, this might get uncomfortably large at some point.

If this program is interactive, though, you might want to use something like "screen" instead.

Lenin1 10-07-2016 03:59 PM

The nohup output problem
 
I run Wildfly and it output file names / max size / number of files before rolling didn't work while I use nohup even if I declare same path for output. You mention something about screen do you know more details about it?

goumba 11-23-2016 01:56 PM

Code:

anthony@miranda:~$ apt-cache show screen
Package: screen
Version: 4.4.0-6
Installed-Size: 981
Maintainer: Axel Beckert <abe@debian.org>
Architecture: amd64
Depends: libc6 (>= 2.15), libpam0g (>= 0.99.7.1), libtinfo5 (>= 6)
Suggests: byobu | screenie | iselect (>= 1.4.0-1), ncurses-term
Description-en: terminal multiplexer with VT100/ANSI terminal emulation
 GNU Screen is a terminal multiplexer that runs several separate "screens" on
 a single physical character-based terminal. Each virtual terminal emulates a
 DEC VT100 plus several ANSI X3.64 and ISO 2022 functions. Screen sessions
 can be detached and resumed later on a different terminal.
 .
 Screen also supports a whole slew of other features, including configurable
 input and output translation, serial port support, configurable logging,
 and multi-user support.
Description-md5: 2d86b86ed6058a04c540802e49312f40
Homepage: https://savannah.gnu.org/projects/screen
Tag: hardware::input:keyboard, implemented-in::c, interface::text-mode,
 role::program, scope::utility, suite::gnu, uitoolkit::ncurses,
 works-with::software:running
Section: misc
Priority: optional
Filename: pool/main/s/screen/screen_4.4.0-6_amd64.deb
Size: 597136

As stated above, one of the greatest benefits of screen is that you can detach, close your ssh session, and then reattach to that screen session later on, picking up exactly where you left off - even from a different remote workstation.


All times are GMT -5. The time now is 03:42 PM.