LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Will process still run after disconnecting? (https://www.linuxquestions.org/questions/linux-newbie-8/will-process-still-run-after-disconnecting-4175501315/)

ilesterg 04-11-2014 01:55 AM

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!

ilesterg 04-11-2014 02:00 AM

Of course, nohup is the workaround, but what if I don't use nohup?

TenTenths 04-11-2014 03:53 AM

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.

ilesterg 04-11-2014 04:25 AM

Quote:

Originally Posted by TenTenths (Post 5150593)
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.

TenTenths 04-11-2014 04:37 AM

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"


All times are GMT -5. The time now is 11:40 AM.