How to see if the process is idle


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to see if the process is idle
# 1  
Old 08-30-2007
How to see if the process is idle

We are running AIX 5.3 and for ICICS Printing we have process called cicstermp runing whcih attaches the print to print queue

But is process is triggered when ever a print is to be given

Can we find the processes which are idle

I mean every time a print is given it creats a new cicstermp process but it doesnot kill it when its done

Can we find these kind of processes
Some times even if the shell which triggered it gets closed the process runs with out a terminal

I am posting few of those output form ps -ef


root 5931186 1 0 10:00:12 pts/29 0:00 cicstermp -r CICSREGION -n PRINTER -P lp -cs -dcaisse

root 6017234 1 0 Aug 28 - 0:00 cicstermp -r CICSREGION -n PRINTER -P lp -cs -dcaisse
# 2  
Old 11-26-2007
Hi,
i hope this will help you

# Checking and counting the process [ABC.EXE] which is running on root directory "/"
COUNT=`cd / |ps -ef |grep ABC.EXE |wc -l`

# THIS WILL CHECK EITHER SERVICE IS RUNNING OR NOT
if [ $COUNT = 0 ]
then
ABC.EXE
echo "SERVICE STARTED"
exit 0
fi

# THIS WILL CHECK IF THE SERVICE IS RUNNING ONLY ONCE
if [ $COUNT = 1 ]
then
echo "SERVICES ALREADYRUNNING"
exit 0
fi

# THIS WILL CHECK IF THE SERVICE IS RUNNING MORE THAN ONCE
if [ $COUNT > 1 ]
then
banner ERROR
echo "SERVICES HALTED - MORE THAN ONE INSTANCE"
echo "PLEASE RESTART"
echo "PRESS ANY KEY TO CONTINUE"
read exit
exit 0
fi
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Idle command to kill the process running n unx box machine

Hi Team , I have one process named as cec_analysiseool that is running on unix box machine now i want to kill this process so please advise what will be the ideal command to kill this , what i have tried is :confused: kill -9 `ps -ef | grep cec_analysiseool | grep -v grep | awk '{print $2}'` (2 Replies)
Discussion started by: unclesamm
2 Replies

2. UNIX for Dummies Questions & Answers

Idle Process Exhausting CPU

I noticed when having some trouble with code I was testing that the CPU was becoming exhausted and I would have to reboot. After rebooting a couple times I decided to check for other problems before trying my code again. That's when I noticed that the CPU with the idle process was through the roof:... (5 Replies)
Discussion started by: Azrael
5 Replies

3. SCO

User process information and idle times

My company uses a proprietary GUI to its business system (Strategix) which runs on Windows clients, whereas the back-end runs on a SCO OpenServer 5.0.6a server. We're moving to a new business system next year and the business is growing and we're running out of licences on Strategix and making... (1 Reply)
Discussion started by: mmcardle
1 Replies

4. Shell Programming and Scripting

Kill idle Process using a script

Hi, I need a script that can automatically kill all processes named "webrepn" and "webrebw" if idle for more than 30 minutes. Then I will have a Cron Job to run the script every night or 2-3 times a day depends on how this script helps. Right now, I run "ps -ef | grep webrebn" and "kill -9... (7 Replies)
Discussion started by: MaggieL
7 Replies

5. Solaris

Why CPU idle 0 process nohub lose

Hello Solaris 8 when CPU idle 0 . why nohub process lose ? Thank (1 Reply)
Discussion started by: ppmanja
1 Replies

6. AIX

Kill IDLE Process using script !!!

Dear Friends , I am using DB2 database in AIX 5.3 server . In my server some IDLE process are generated after several times which I need to kill it manually each and every time . The process I query like following : root@bagpuss $ ps auxw|sort -r +3|head -10 USER PID %CPU %MEM ... (3 Replies)
Discussion started by: shipon_97
3 Replies

7. Shell Programming and Scripting

How to run a process when the computer is idle?

Hi there, I wrote a script that scans a folder for new files. I don't want to run it at specific times but only when the computer is NOT busy. I tried to use nice but it doesn't really work. I mean, even if my process has less priority, it still slows down the other processes. I did a test... (3 Replies)
Discussion started by: chebarbudo
3 Replies

8. Shell Programming and Scripting

How to kill process after x idle min?

I need a script to kill those process id whose idle time is more than 30min plz help me (3 Replies)
Discussion started by: salil2012
3 Replies

9. AIX

Idle Oracle Process has removed automatically in AIX5.2

Hello, I am creating oracle connection from one aix5.2 machine to another aix5.2 database machine. Oracle connection i am reusing it always. If there is now work for java thread to process, oracle instance will be idle and will be active once java thread processes. We have installed OS... (1 Reply)
Discussion started by: balareddy
1 Replies

10. Shell Programming and Scripting

finding idle time of a process

Matez, I have a list of process id's in a text file. I want to know how to find the idle time of a process which are more than 300secs and kill them accordingly. Could you please help me to get these details. I want to write a shell script with this. Thanks..Krish :) (36 Replies)
Discussion started by: Krrishv
36 Replies
Login or Register to Ask a Question