LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-22-2004, 03:45 PM   #1
TrulyTessa
Member
 
Registered: Nov 2004
Location: Canada, eh
Distribution: SuSE 9.2 Pro
Posts: 63

Rep: Reputation: 15
nohup not preventing jobs from getting killed


I was having problems with my SAS jobs getting killed whenever my session ended. I came across this thread suggesting use of the nohup command to prevent jobs from shutting down when they receive the hup signal. So, in my .bashrc file, I aliased the sas command as nohup sas so that anytime I run a SAS job, I invoke the nohup command. Sounds good so far, right?

Today I was running a long SAS job and it was randomly killed. I found this error message in the log file:

ERROR: System is Terminating Due to Hang Up Signal (SIGHUP)

How can SAS be responding to the hup signal when I started the job using nohup?

In the thread I cite above, folks discussed using the screen command. Does anyone know if screen can be used remotely (I log in remotely using SSH) or do you have to be right in front of your, umm, screen to use it?

Thanks
 
Old 12-22-2004, 03:54 PM   #2
Mikhail_16
Member
 
Registered: Oct 2003
Distribution: Gentoo rules them all
Posts: 279

Rep: Reputation: 31
screen is a virtual terminal, which means it can be attached and detached from anywere, over ssh, locally, etc.
The problem with screen is that its just that: a terminal, so it does not prevent anything from dying. so you are not guaranteed that program will nto die next time it sees term signal. and btw, when you use nohup the correct formatting is 'nohup [command] &' -- & sign makes sure that the thread is detached and goes into the background so your closure of ssh session does not kill nohup execution.
 
Old 12-22-2004, 03:59 PM   #3
TrulyTessa
Member
 
Registered: Nov 2004
Location: Canada, eh
Distribution: SuSE 9.2 Pro
Posts: 63

Original Poster
Rep: Reputation: 15
Yes, that's the way I'm using nohup. I always run my sas jobs in background (with &), so by aliasing sas to nohup sas, everytime I command sas job.sas &, it executes as nohup sas job.sas &. Thanks for checking though.
 
Old 12-22-2004, 08:43 PM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
How can SAS be responding to the hup signal when I started the job using nohup?
A login shell does not read .bashrc. Perhaps that is the cause of the problem. Might I suggest that you create a .profile and have a line in there to source your .bashrc.
 
Old 12-24-2004, 11:39 AM   #5
TrulyTessa
Member
 
Registered: Nov 2004
Location: Canada, eh
Distribution: SuSE 9.2 Pro
Posts: 63

Original Poster
Rep: Reputation: 15
Perhaps, but the session was recognizing all the other aliases I had set up in the .bashrc. I'll dig around to learn how to set up a .profile and see if that fixes the problem. Thanks.
 
  


Reply


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
Nohup and Background Jobs Onyx2316 Linux - Newbie 3 02-28-2012 12:10 AM
nohup retuncode krusty_lab Linux - General 2 10-13-2005 06:04 AM
help on nohup vinayuh Linux - General 3 07-22-2005 12:24 PM
nohup command chbin Slackware 1 03-31-2005 03:47 AM
nohup failure tn1681 Programming 1 01-09-2003 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration