LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-28-2018, 02:11 PM   #1
unni.kpr@gmail.com
LQ Newbie
 
Registered: Sep 2011
Posts: 10
Blog Entries: 2

Rep: Reputation: Disabled
Unhappy Not showing Done for script run in background for Centos-7


Hi,

I have moved our one of the script server from Cento6 to Cento7. The problem is the user connected to the server run batch jobs using & sign. But now the Status Done is not showing without keyboard interrupt. The users are sitting idle and wait to show the Done status even the program done executing. How do i fix this.

Regards,
Unni.
 
Old 04-28-2018, 02:52 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
That's how background jobs have always worked in my experience. (Solaris, Centos, RHEL)...There is no notification of the completion of the background job until after some following keyboard activity...I usually just press enter until I get the Done...or run ps command to see it's still running.
That said, I find this in man bash:
Code:
The shell learns immediately whenever a job changes state.  Normally, bash waits until it is about to print a prompt before reporting changes in a job's status so as to not interrupt any other
output.  If the -b option to the set builtin command is enabled, bash reports such changes immediately.
so
Code:
set -b
added to ~/.bashrc or /etc/bashrc should do what you want.

Welcome to LQ.
 
1 members found this post helpful.
Old 04-29-2018, 03:50 AM   #3
unni.kpr@gmail.com
LQ Newbie
 
Registered: Sep 2011
Posts: 10

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Scasey

Thanks for the details it worked.it worked:-)
 
Old 04-29-2018, 10:00 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
You are most welcome. Please mark the thread "Solved" using the Thread Tools...
 
  


Reply



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
[SOLVED] If I run a script in the background, where does it's output go? wh33t Linux - General 6 06-04-2017 01:55 AM
Run a script in background mithun119 Linux - Newbie 7 10-15-2014 03:51 AM
run script in background MikeQ Linux - Newbie 2 09-11-2009 06:21 PM
How to run a shell script in a background? anandv_1234 Linux - Newbie 3 12-23-2007 03:03 AM
how do i get a shell script to run in the background? tjyorkshire Programming 4 07-06-2007 02:28 AM

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

All times are GMT -5. The time now is 05:34 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