LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-22-2007, 11:37 AM   #1
bnbguy
LQ Newbie
 
Registered: May 2007
Posts: 6

Rep: Reputation: 0
Question Background job problem in RedHat 7.2


Hello, all. I'm running RH 7.2 on a converted Hewlett-Packard, and I'm having an odd problem with a script I want to run as a background job.

First, I can run the script just fine in the foreground, and start it OK in the background. But after a certain period of time I get a message saying the job is stopped. I can restart it in the fg, but if I do so in the bg after a while the same thing recurs.

I checked my documentaion, and it said a background job would stop if it read from stdin, or wrote to stdout with a certain option set. The script has no points where it asks for input, and the tostop flag on stty is not set. Is there another reason it might stop, or some setting in RH 7.2 I need to adjust?

Second, I want this script to be started in the background on bootup. I tried adding a script to call it to /etc/rc.d/init.d but it doesn't seem to be starting. Would it work better if I added a line calling it to rc.local, or is there some config file for init.d I need to add my calling script to?

Thanks, everybody.
 
Old 05-22-2007, 03:31 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You'll probably need to add it to a runlevel, or use the @reboot cron syntax.

As for your main problem: can you determine at what point it is stopping? That might narrow down the cause somewhat.
 
Old 05-22-2007, 08:43 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
What type of script is this? If it's just a bash script and you're having problems with it dying off by invoking it to run in the background, then I'd say try running it in a screen session to get more output of why it's dying.
 
Old 05-23-2007, 05:03 PM   #4
bnbguy
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks, guys. Adding a line to rc.local that invoked the script in the background fixed the problem: It comes up everytime I reboot and doesn't time out.
 
  


Reply

Tags
error



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron job will not background when username contains underscore mcbain SUSE / openSUSE 2 12-07-2006 09:13 AM
Background job output jake2 Slackware 6 07-09-2006 10:37 PM
changing variables from background job bobwall Programming 2 06-18-2005 02:28 PM
Sending a job straight to background detly Linux - General 4 02-02-2005 02:51 AM
how to stop background job jax8 Linux - Newbie 6 02-17-2004 12:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:45 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
Open Source Consulting | Domain Registration