Labels

algorithms (22) Design Patterns (20) java (19) linux (14) Snippet (13) service mix (6) soa (4)

Processes in Linux

f

Program  ?

  • process if different from a program.
  • Program under execution is a process.
  • Program is set of instructions.

INIT: Mother of all the processes.

  • Fork: if there is process P1 can fork out into multiple processes which are identical,Independent P1 and P2 with different PID’s.
  • Exec:
  • Wait:

Rights of Process

  1. Who am i ? what is its pid
  2. who is my parent ? what is my parent process id
  3. what happened to my child ?

Orphan Process :

the process whose parent died,when a parent process is killed the INIT process takes the responsibility that's the reason its called mother of all the processes.

Zombie Process :

A process

 

PS

processes running on your terminal

[trainee@localhost purna]$ ps
  PID TTY          TIME CMD
6188 pts/14   00:00:00 bash
6507 pts/14   00:00:00 ps

number of processes running

[trainee@localhost purna]$ ps -e|wc -l
164

processes running on a terminal pts/3

[trainee@localhost purna]$ ps -tpts/3
  PID TTY          TIME CMD
4300 pts/3    00:00:00 bash
6612 pts/3    00:00:00 cat

DAEMON

Disk And Execution Monitor

JOBS

will print all the jobs which are stopped or paused .

to resume these jobs one can use fg or bg (foreground or background) %JOB_NUMBER

KILL

list all signals

[trainee@localhost purna]$ kill -l
1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL
5) SIGTRAP      6) SIGABRT      7) SIGBUS       8) SIGFPE
9) SIGKILL     10) SIGUSR1     11) SIGSEGV     12) SIGUSR2
13) SIGPIPE     14) SIGALRM     15) SIGTERM     16) SIGSTKFLT
17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU
25) SIGXFSZ     26) SIGVTALRM   27) SIGPROF     28) SIGWINCH
29) SIGIO       30) SIGPWR      31) SIGSYS      34) SIGRTMIN
35) SIGRTMIN+1  36) SIGRTMIN+2 37) SIGRTMIN+338)SIGRTMIN+4}Dummy signals
39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12
47) SIGRTMIN+13 48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14
51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10
55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7  58) SIGRTMAX-6
59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX

Kill A Process

[trainee@localhost purna]$ kill -s SIGKILL 4524

where 4524 is the process id

Nice

the lesser the Nice value the higher the priority

only the root can make the priority higher or nice value to low.

No comments:

Post a Comment

Search 24 Bytes