LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-29-2003, 08:12 AM   #1
rkrijger
LQ Newbie
 
Registered: Mar 2003
Posts: 17

Rep: Reputation: 0
Need a challange?!? Try to solve this one: INTER PROCES COMMUNICATION


This is a nice problem:

- i want to have a program with UI-buttons that performs the following:
(1) if i press a button to "ON" it activates a shell script
(2) if i press a button to "OFF" it kills this shell script
(3) if the shell script terminates (OR gets killed by anyone else),
the corresponding button in the program should go to "OFF"
and (last but not least)
(4) it should be possible to have multiple instances of this program that all have valid indicators for the corresponding scripts that run (or not)

Example:
=======

The program CONTROL that has a button "Start Production"
I invoke this program CONTROL several times.
Selecting the button in one of the CONTROL apps, invokes the shell script "startprod" AND (!!!) it should lit all corresponding buttons "Start Production" in the other instances of CONTROL.

Then I manually kill this script.

Now all buttons should go to "OFF"...

Well, taking care of (1) and (2) is not so difficult: I have created an "in between script" that is called with 1 (button was pressed) or 0 (button was released) by the program CONTROL. The "inbetween script" kills or calls "startprod" (i store pid's in files).

But taking care of (3) and (4) is a bit more difficult... Any ideas?!?

Let's find out who the clever guys are here!!!
 
Old 10-29-2003, 09:43 AM   #2
tefal
Member
 
Registered: Jul 2003
Location: S. Wales
Distribution: Fedora Core 5, SuSE 9.1 Pro
Posts: 30

Rep: Reputation: 15
How about when the process 'startprod' is created, store the PID of the process in a file somewhere and have all instances looking for this file at regular intervals.

If the file exists, read in the process ID and monitor it to see if it is still running. If it dies, then it no longer exists and each Control process reacts similarly.

Just make sure that if the process is killed, then either remove the file containing the PID or empty it.

-Tefal
 
  


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
A Challange to all webwolf70 General 0 09-29-2005 07:36 PM
User proces limit webserve Linux - Security 7 08-12-2005 07:52 PM
inter-program communication Raspis21 Programming 9 07-22-2005 02:49 AM
Seperate compile from the rest of the installation proces csvke Linux - Software 4 01-21-2005 10:18 PM
Error Proces Booting After Compiling Kernel 2.6.3 Gijet Red Hat 7 06-04-2004 10:21 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration