LinuxQuestions.org
Visit Jeremy's Blog.
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 02-09-2011, 06:34 AM   #1
alwaysshri
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
Background process execution hangs console and ip communication


Hello

I have 3 processes to be executed in a particular sequence.
ProcessA
ProcessB
ProcessC

The requirement is that all the processes should run as background processes.
ProcessA talks to ProcessB and ProcessC using sockets.
ProcessB talsk to ProcessA only using sockets.
ProcessC talsk to ProcessA only using sockets.

Two situations:

* If ProcessA is started in background, ProcessB in foreground and ProcessC in background, all is well and good.
* If ProcessA is started in background, ProcessB in background, then the moment ProcessC in started (either foreground or background), shell hangs, telnet/ssh to the target fails.

Environment:

OS: MontaVistaLinux
Processor: PowerPC
Shell: sh
Language: C
ProcessC: NetSnmp Agent (snmpd)

More details:
The processes are started through a shell script "start_me.sh" - ProcessA is started first
- Sleep for 3 seconds
- Start ProcessB
- Sleep for 30 seconds
- Start ProcessC

Pipes are used by ProcessB only for its internal task communication purposes only.
Inter Process Communication is through loopback TCP sockets.

What can be going wrong here?

Last edited by alwaysshri; 02-10-2011 at 10:46 PM.
 
Old 02-10-2011, 05:03 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

Maybe I'm missing something, but "Shell: OpenBSD" doesn't make any sense to me.
Wouldn't that be "csh, ksh, bash, sh, zsh" or the like?

Regardless, are you starting ProcessA, ProcessB, and ProcessC all in the same terminal window?
What happens if you open 3 terminals (xterms, Konsoles, etc), and then start & background each process?
 
Old 02-10-2011, 10:48 PM   #3
alwaysshri
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xeleema View Post
Maybe I'm missing something, but "Shell: OpenBSD" doesn't make any sense to me.
Wouldn't that be "csh, ksh, bash, sh, zsh" or the like?
Sorry, Shell is sh. Edited the post.

Quote:
Originally Posted by xeleema View Post
Regardless, are you starting ProcessA, ProcessB, and ProcessC all in the same terminal window?
What happens if you open 3 terminals (xterms, Konsoles, etc), and then start & background each process?
The behaviour is the same.
 
Old 02-11-2011, 05:07 AM   #4
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Is there any way you could post the code?
(please wrap your script(s) in [noparse][code][noparse] and [noparse][/code][noparse] tags)
 
  


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
Pipe and background execution pn8830 Linux - Newbie 3 07-15-2008 10:47 AM
process communication andyar85 Programming 4 01-13-2008 07:02 PM
How to find the process ID of process executing in the background akeneche Linux - Newbie 1 01-03-2008 10:08 AM
Process Communication erdemilhan Programming 1 11-27-2004 04:06 PM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 12:27 AM

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

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