You are not logged in.

#1 2014-03-23 17:32:15

Bailando
Member
From: Hungary
Registered: 2013-08-19
Posts: 133
Website

My process interrupts when I hibernate while running SSH, what to do?

Hi!

I have a low-end box (512 MB RAM, 1 processor, 15 GB hard disk, 2 TB / month bandwith, Arch Linux) , and I connect to it by SSH. Currently I use it for uploading / downloading stuff, and video encoding. My problem is when I transcode the video by FFmpeg - it takes long time, about 8 hours - and when I hibernate my home machine, the FFmpeg process aborts on the remote box and the resulting video file will be truncated. What can I do to avoid this annoyance?

Offline

#2 2014-03-23 17:42:49

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: My process interrupts when I hibernate while running SSH, what to do?

Run it in a screen or tmux session and detach it (the process will keep running on the remote box regardless of what happens to your local machine).


Burninate!

Offline

#3 2014-03-23 18:11:32

Bailando
Member
From: Hungary
Registered: 2013-08-19
Posts: 133
Website

Re: My process interrupts when I hibernate while running SSH, what to do?

What happens if I press Ctrl+Z and then I type "bg". The process will run in background, will it abort when I hibernate or simply close the SSH window?

Offline

#4 2014-03-23 20:25:31

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: My process interrupts when I hibernate while running SSH, what to do?

Yes it will abort because you are killing that terminal session. Use tmux or screen!

Offline

#5 2014-03-23 21:34:35

Bailando
Member
From: Hungary
Registered: 2013-08-19
Posts: 133
Website

Re: My process interrupts when I hibernate while running SSH, what to do?

Thx, but where should I run Screen, on my home computer, or on the remote low-end box?

Offline

#6 2014-03-23 22:01:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: My process interrupts when I hibernate while running SSH, what to do?

Where you want the long running process to live...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-03-24 11:23:58

Blµb
Member
Registered: 2008-02-10
Posts: 224

Re: My process interrupts when I hibernate while running SSH, what to do?

When your client hibernates, the ssh connection times out and the remote's ssh client session is terminated. This sends a SIGHUP to all the child processes, to which the default reaction is termination. The 2 most common ways to deal with this are either the 'nohup' command (`man 1 nohup`) (which I personally dislike and try to avoid because its default behavior is to send stdout/err to 'nohup.out'), or running the commands in a tmux/screen session, which is something you should learn/know about either way. The moment you start using ssh is the moment you lose every right to argue against screen/tmux wink (even for local work they're perfectly useful tools)

My personal favourite is tmux.

Last edited by Blµb (2014-03-24 11:25:03)


You know you're paranoid when you start thinking random letters while typing a password.
A good post about vim
Python has no multithreading.

Offline

Board footer

Powered by FluxBB