Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to write script to find and kill duplicate processes....

Status
Not open for further replies.

rtdonnelly

Technical User
Nov 8, 2006
7
US
Hello,

I am looking for a way to script the process of finding and killing duplicate processes that may be started on our AIX servers. Anyone know of a way to easily do this?? Thanks.
 
Can you provide more details? How do you determine what is the master process? how often does this duplicate process check need to run?

Or better still - have the initial process check for a running flag. If found, exit. If not found, set it and run the process.
 
sbrews said:
If not found, set it and run the process.

....and delete it when the process ends. :)

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

Wish you could view posts with a fixed font? Got Firefox & Greasemonkey? Give yourself the option.
 
sbrews...thanks for your reply. The master process would be the initial process started with the earliest time stamp. There should never be more than one process running, thus the desire to kill any subsequent processes. We would like to check for additional processes every 15 minutes.

We like your idea of checking for a running flag and exiting if found. How would we go about doing this? Thanks.
 
when the process starts, you could have it write a file to temp (or some other suitable location). That file could be called PROCESS_X_IS_RUNNING.

All subsequent processes should check for that file, if found, exit, otherwise go ahead and run. When the original process is done, have it delete that file.

If the process is an EXE (ie not a script), perhaps you can wrap a script around it to create the file and launch the app.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top