LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2014, 02:55 AM   #1
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 505

Rep: Reputation: 54
Cool Will process still run after disconnecting?


Hi,

I log in to a remote system through ssh (using putty), run a process/command which runs for about a hour, then I got disconnected since my putty doesn't send keepalives.

Will the process get killed since my active session got killed?

Thanks!
 
Old 04-11-2014, 03:00 AM   #2
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 505

Original Poster
Rep: Reputation: 54
Of course, nohup is the workaround, but what if I don't use nohup?
 
Old 04-11-2014, 04:53 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,172

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
If you don't want to use nohup then run your command / script from a "one time" cron job.

If you set the time, day and month that gives you a year to remove the cron job before it'll run again.
 
Old 04-11-2014, 05:25 AM   #4
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 505

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by TenTenths View Post
If you don't want to use nohup then run your command / script from a "one time" cron job.

If you set the time, day and month that gives you a year to remove the cron job before it'll run again.
Thanks, yes we can use cron or at though, my concern really is about processes which are run adhoc on a ssh session.
 
Old 04-11-2014, 05:37 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,172

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Try this for a cheesy workaround:

Fork it in to the background with &, get the PID then run the following where XXXX is the PID

Code:
watch "ps -aux | grep XXXX | grep -v grep"
 
  


Reply

Tags
process, session, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How would you run a process in the background? turbomen Linux - Newbie 1 11-16-2010 03:43 AM
A lot of processes run automatically when I run a single process. dalvirgautam Linux - Enterprise 4 12-01-2006 07:10 PM
Run a process on more CPUs simonj82 Linux - Server 2 11-09-2006 09:51 PM
how get a process run time henryluo Linux - Newbie 9 06-10-2004 11:45 PM
disconnecting from a process without terminating it linxtc Linux - General 1 09-22-2003 12:47 AM


All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration