How can I learn the status of a process


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I learn the status of a process
# 1  
Old 12-22-2011
How can I learn the status of a process

how can I learn the status of a process (sleeping, running or ready.)
# 2  
Old 12-22-2011
I don't know what 'ready' would be, but ps tells you the status of a process:

Code:
$ ps 1
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     0:11 init [3]
$ man ps
...

PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D    Uninterruptible sleep (usually IO)
R    Running or runnable (on run queue)
S    Interruptible sleep (waiting for an event to complete)
T    Stopped, either by a job control signal or because it is being traced.
W    paging (not valid since the 2.6.xx kernel)
X    dead (should never be seen)
Z    Defunct ("zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may
be displayed:
<    high-priority (not nice to other users)
N    low-priority (nice to other users)
L    has pages locked into memory (for real-time and custom IO)
s    is a session leader
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+    is in the foreground process group

...
$

So Ss means it's asleep and is a session leader.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 12-26-2011
I will write a kernel module that is prints the # of running, # of sleeping, # of zombie processes etc. for example
running sleeping waiting..........
5 8 1.................

but ı Don't know how ı can reach that status infos.
at your answer, it writes Ss, Ssl, Z, R+, S and I dont know the meaning of them.

---------- Post updated at 07:14 PM ---------- Previous update was at 07:10 PM ----------

ok I know understand, now l can start my homework thank you
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Check status of process

Hi All, Have a query How to check for a process and if down start it , try if for 2 times and its not starting don't do it My code is working to some extent but while starting try starting both times. Please advise , whats wrong here ? if you have any other approach please do share. My... (1 Reply)
Discussion started by: abhaydas
1 Replies

2. Shell Programming and Scripting

how to exit status of a piped process ???

Hi, I've searched the related threads both in this forum and others in google and found the solution to be working too in most of the places. But somehow it's not working for me. $cmd | tee -a $LOGFILE & pid=$! wait ${pid} ret=$? echo "$ret" I want the exit status of the $cmd.... (8 Replies)
Discussion started by: ashwini.engr07
8 Replies

3. UNIX for Dummies Questions & Answers

Process status for NOHUP command

Hi, I have run a shell script as a background process using 'nohup' command. I want to see the process id of this, so that I will be able to kill it later on when required. I tried to collect these details using 'ps' command and could not view this information. How do we get this... (5 Replies)
Discussion started by: Dev_Dev
5 Replies

4. Shell Programming and Scripting

How to check the process status

Hi, I have a cron job which runs every ten minutes, now i hav to check the process whether it is running or not only once and then this should be sent to a log file.. crontab : 00,10,20,30,40,50 * * * * a process check ps = 'ps -ef |grep a ' if then echo " Success" >... (3 Replies)
Discussion started by: NehaKrish
3 Replies

5. Shell Programming and Scripting

How to Check the process Status and do something

Hi we have weblogic deployed under Linux Enterprise 5 . Now i want to write a script that checks if weblogic is running or not I have found that weblogic uses Java as process . Can i do this way : my Script File : Echo Checking Status if then echo Server Running else echo... (2 Replies)
Discussion started by: Ravi Pavanv
2 Replies

6. UNIX for Advanced & Expert Users

Status of a Linux process

All, I have fair amount of knowledge about shell scripting, but only liitle on system administration. I would like to know how to analyze whether the particular linux process is alive or not ? If it is alive, will it affect the performace of other process ?. Also is it still consuming... (1 Reply)
Discussion started by: apsprabhu
1 Replies

7. Programming

process status

hello everybody!! i want to post a question! is there any way to get process status using C commands? To be more specific, i want to know whether a process is running or is stop or killed. thanks in advance! (3 Replies)
Discussion started by: nicos
3 Replies

8. UNIX for Advanced & Expert Users

List Process with their Status.

Hi all, How can I get the list of all the processes that are either Orphan or Zombie or Running or Ended or Stopped ? Please suggest !! Thanks. Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

9. UNIX for Advanced & Expert Users

Getting status of a signal in process?

Hi all, How can a process be aware of the signals it handles. I looked at available signal API, but couldn't find any help. If a process defines it own handler for a signal, the default handler for that signal becomes overridden. I am interested in getting to know the... (2 Replies)
Discussion started by: bluehive
2 Replies

10. AIX

Process status display

On AIX 5.2, I use "ps -ef " command to display the process status, the field of command looks like: , the detailed contents are: # ps -ef |grep rtesfmrt Display: osa 32455 1 0 18:20 - 1:57 The origianl format shoud be: osa 32455 1 0 18:20 - 1:57 ... (2 Replies)
Discussion started by: Frank2004
2 Replies
Login or Register to Ask a Question