SlideShare a Scribd company logo
1 of 9
Introduction to Unix and OS
Module 2 Continued……
Dr. Girisha G S
Dept. of CSE
SoE,DSU, Bengaluru
1
Agenda
• Process States and Zombies
• Running jobs in background
• Killing processes with Signals
2
Process States
1 Runnable Sate :
2. Running State :
3. Waiting (or sleeping)/Suspended State:
4. Zombie state :
Process states are :
Figure. Process State Diagram
3
Zombie Process
A zombie process is one which has exited, but its parent hasn't yet issued a wait()
system call to observe its termination state
Orphan Process
Process whose parent process no more exists i.e. either finished or terminated without
waiting for its child process to terminate is called an orphan process.
4
Running Jobs in Background
Foreground Job: The process that is connected to the terminal is called
the foreground job
E.g. A foreground process begins by typing a command at the prompt. For
example, type ls to see a simple listing of the files in the current directory
Background Job: Process that runs behind the scenes (i.e., in the background) and
without user intervention
E.g. sorting a large file in the background
Jobs
- This command lists jobs running in the background
E.g $ jobs
[3]+ running grep ‘director emp.dat &
[2]- running sort employee.data>sortedlist.data &
[1] supended wc –l hugefile.txt
5
2. nohup- no hangup
- nohup command permits execution of the process even after the user has
logged out.
- Use & with it as well
E.g. $nohup sort emp.lst &
586
sending output to nohup.out
Two ways of starting jobs in background
1. With shell’s & operator
The shell’s & operator used to run a job in the background
E.g. Sort a file called ‘foo’ and place the results in a file called ‘bar’
$ sort <foo >bar &
550 //jobs PID
- This method run in the background but the process will be killed if you logout.
6
Killing processes with Signals
- Some times you want or need to terminate a process.
- The following are some reasons for stopping a process
• Its using too much CPU time
• It is running too long without producing the expected
output
• Its no longer useful
How to get out of these situations?
• Use kill command to stop the background process
• press <ctrl-c> to stop a command that is not in the background
7
Kill – premature termination of a process
- Kill command is used to terminate a process
- Issuing a kill command sends a signal to a process
- Unix programs can send or receive more than 20 signals each of
which is represented by a number
- Use kill -l to list all signal names and numbers
8
Two forms of using kill command
Kill PIDs
– uses one or more PIDs as arguments
Kill -Number PIDs
- Uses signal number as option and PID as arguments
Examples
1. kill a process whose PID is 123
$ kill 123
2. Kill a process with signal number 9 whose PID is 123
$ kill -9 123
9

More Related Content

What's hot

Flat panel displays and plasma panel displays
Flat panel displays and plasma panel displays Flat panel displays and plasma panel displays
Flat panel displays and plasma panel displays hemanth kumar
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)Zubair Khalid
 
operating system
operating systemoperating system
operating systemKadianAman
 
State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniquesKirti Verma
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Jotham Gadot
 
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTRE
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTREBASIC COMPUTER COURSE ! BATRA COMPUTER CENTRE
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTREjatin batra
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphicsSafayet Hossain
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecturefika sweety
 
Operating system
Operating systemOperating system
Operating systemvivek anand
 
Operating system 02 os as an extended machine
Operating system 02 os as an extended machineOperating system 02 os as an extended machine
Operating system 02 os as an extended machineVaibhav Khanna
 
Lecture optimal binary search tree
Lecture optimal binary search tree Lecture optimal binary search tree
Lecture optimal binary search tree Divya Ks
 
Chapter 8 Operating Systems And Utility Programs
Chapter 8 Operating Systems And Utility ProgramsChapter 8 Operating Systems And Utility Programs
Chapter 8 Operating Systems And Utility Programsnorzaini
 
History of Operating system
History of Operating systemHistory of Operating system
History of Operating systemtarun thakkar
 

What's hot (20)

Direct Memory Access ppt
Direct Memory Access pptDirect Memory Access ppt
Direct Memory Access ppt
 
Flat panel displays and plasma panel displays
Flat panel displays and plasma panel displays Flat panel displays and plasma panel displays
Flat panel displays and plasma panel displays
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
operating system
operating systemoperating system
operating system
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Raster Scan display
Raster Scan displayRaster Scan display
Raster Scan display
 
State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniques
 
Backtracking
BacktrackingBacktracking
Backtracking
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 
Presentation On Operating system
Presentation On Operating systemPresentation On Operating system
Presentation On Operating system
 
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTRE
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTREBASIC COMPUTER COURSE ! BATRA COMPUTER CENTRE
BASIC COMPUTER COURSE ! BATRA COMPUTER CENTRE
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphics
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecture
 
Operating system
Operating systemOperating system
Operating system
 
CUDA Architecture
CUDA ArchitectureCUDA Architecture
CUDA Architecture
 
Operating system 02 os as an extended machine
Operating system 02 os as an extended machineOperating system 02 os as an extended machine
Operating system 02 os as an extended machine
 
Lecture optimal binary search tree
Lecture optimal binary search tree Lecture optimal binary search tree
Lecture optimal binary search tree
 
Chapter 8 Operating Systems And Utility Programs
Chapter 8 Operating Systems And Utility ProgramsChapter 8 Operating Systems And Utility Programs
Chapter 8 Operating Systems And Utility Programs
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
History of Operating system
History of Operating systemHistory of Operating system
History of Operating system
 

Similar to Introduction to Unix OS processes, jobs, signals and killing processes

System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Processlucita cabral
 
3.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v23.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v2Acácio Oliveira
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10duquoi
 
04_ForkPipe.pptx
04_ForkPipe.pptx04_ForkPipe.pptx
04_ForkPipe.pptxvnwzympx
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processesAcácio Oliveira
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linuxMazenetsolution
 
Process management
Process managementProcess management
Process managementBirju Tank
 
101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2Acácio Oliveira
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot ProcessArvind Krishnaa
 
Demystifying the Go Scheduler
Demystifying the Go SchedulerDemystifying the Go Scheduler
Demystifying the Go Schedulermatthewrdale
 

Similar to Introduction to Unix OS processes, jobs, signals and killing processes (20)

Processes
ProcessesProcesses
Processes
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Process
 
3.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v23.5 create, monitor and kill processes v2
3.5 create, monitor and kill processes v2
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10
 
04_ForkPipe.pptx
04_ForkPipe.pptx04_ForkPipe.pptx
04_ForkPipe.pptx
 
Process
ProcessProcess
Process
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Process management
Process managementProcess management
Process management
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
LP-Unit3.docx
LP-Unit3.docxLP-Unit3.docx
LP-Unit3.docx
 
UNIX Notes
UNIX NotesUNIX Notes
UNIX Notes
 
101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2101 3.5 create, monitor and kill processes v2
101 3.5 create, monitor and kill processes v2
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
Process management
Process managementProcess management
Process management
 
Syslog.ppt
Syslog.pptSyslog.ppt
Syslog.ppt
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot Process
 
Lect3 process
Lect3 processLect3 process
Lect3 process
 
Demystifying the Go Scheduler
Demystifying the Go SchedulerDemystifying the Go Scheduler
Demystifying the Go Scheduler
 

More from Dr. Girish GS

unix- Sort, uniq,tr,grep
unix- Sort, uniq,tr,grepunix- Sort, uniq,tr,grep
unix- Sort, uniq,tr,grepDr. Girish GS
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environmentDr. Girish GS
 
File systems and inodes
File systems and inodesFile systems and inodes
File systems and inodesDr. Girish GS
 
Basic regular expression, extended regular expression
Basic regular expression, extended regular expressionBasic regular expression, extended regular expression
Basic regular expression, extended regular expressionDr. Girish GS
 
Loop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamLoop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamDr. Girish GS
 
Logic instructions part 1
Logic instructions part 1Logic instructions part 1
Logic instructions part 1Dr. Girish GS
 
Bcd arithmetic instructions
Bcd arithmetic instructionsBcd arithmetic instructions
Bcd arithmetic instructionsDr. Girish GS
 
Bcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsBcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsDr. Girish GS
 
Ascii arithmetic instructions
Ascii arithmetic instructionsAscii arithmetic instructions
Ascii arithmetic instructionsDr. Girish GS
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructionsDr. Girish GS
 

More from Dr. Girish GS (14)

Unix- the process
Unix-  the processUnix-  the process
Unix- the process
 
unix- Sort, uniq,tr,grep
unix- Sort, uniq,tr,grepunix- Sort, uniq,tr,grep
unix- Sort, uniq,tr,grep
 
Unix - Filters
Unix - FiltersUnix - Filters
Unix - Filters
 
Customizing the unix environment
Customizing the unix environmentCustomizing the unix environment
Customizing the unix environment
 
File systems and inodes
File systems and inodesFile systems and inodes
File systems and inodes
 
Basic regular expression, extended regular expression
Basic regular expression, extended regular expressionBasic regular expression, extended regular expression
Basic regular expression, extended regular expression
 
Loop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamLoop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progam
 
Logic instructions part 1
Logic instructions part 1Logic instructions part 1
Logic instructions part 1
 
Bcd arithmetic instructions
Bcd arithmetic instructionsBcd arithmetic instructions
Bcd arithmetic instructions
 
Bcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructionsBcd and ascii arithmetic instructions
Bcd and ascii arithmetic instructions
 
Ascii arithmetic instructions
Ascii arithmetic instructionsAscii arithmetic instructions
Ascii arithmetic instructions
 
Rotate instructions
Rotate instructionsRotate instructions
Rotate instructions
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Memory interface
Memory interfaceMemory interface
Memory interface
 

Recently uploaded

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Introduction to Unix OS processes, jobs, signals and killing processes

  • 1. Introduction to Unix and OS Module 2 Continued…… Dr. Girisha G S Dept. of CSE SoE,DSU, Bengaluru 1
  • 2. Agenda • Process States and Zombies • Running jobs in background • Killing processes with Signals 2
  • 3. Process States 1 Runnable Sate : 2. Running State : 3. Waiting (or sleeping)/Suspended State: 4. Zombie state : Process states are : Figure. Process State Diagram 3
  • 4. Zombie Process A zombie process is one which has exited, but its parent hasn't yet issued a wait() system call to observe its termination state Orphan Process Process whose parent process no more exists i.e. either finished or terminated without waiting for its child process to terminate is called an orphan process. 4
  • 5. Running Jobs in Background Foreground Job: The process that is connected to the terminal is called the foreground job E.g. A foreground process begins by typing a command at the prompt. For example, type ls to see a simple listing of the files in the current directory Background Job: Process that runs behind the scenes (i.e., in the background) and without user intervention E.g. sorting a large file in the background Jobs - This command lists jobs running in the background E.g $ jobs [3]+ running grep ‘director emp.dat & [2]- running sort employee.data>sortedlist.data & [1] supended wc –l hugefile.txt 5
  • 6. 2. nohup- no hangup - nohup command permits execution of the process even after the user has logged out. - Use & with it as well E.g. $nohup sort emp.lst & 586 sending output to nohup.out Two ways of starting jobs in background 1. With shell’s & operator The shell’s & operator used to run a job in the background E.g. Sort a file called ‘foo’ and place the results in a file called ‘bar’ $ sort <foo >bar & 550 //jobs PID - This method run in the background but the process will be killed if you logout. 6
  • 7. Killing processes with Signals - Some times you want or need to terminate a process. - The following are some reasons for stopping a process • Its using too much CPU time • It is running too long without producing the expected output • Its no longer useful How to get out of these situations? • Use kill command to stop the background process • press <ctrl-c> to stop a command that is not in the background 7
  • 8. Kill – premature termination of a process - Kill command is used to terminate a process - Issuing a kill command sends a signal to a process - Unix programs can send or receive more than 20 signals each of which is represented by a number - Use kill -l to list all signal names and numbers 8
  • 9. Two forms of using kill command Kill PIDs – uses one or more PIDs as arguments Kill -Number PIDs - Uses signal number as option and PID as arguments Examples 1. kill a process whose PID is 123 $ kill 123 2. Kill a process with signal number 9 whose PID is 123 $ kill -9 123 9

Editor's Notes

  1. we will walk you through different process states in Linux. This will be helpful analyzing processes during troubleshooting. Process states defines what process is doign and what it is expected to do in near time. From the birth (spawn) till death (kill/terminate or exit), process has a life cycle going through several states. running or runnable, it is just waiting for the CPU to process it,  process which is being served by CPU currently.  S: Interruptible sleep, waiting for an event to complete, such as input from the terminal Zombie, we discussed in a previous lesson that zombies are terminated processes 
  2. A zombie process is a process whose execution is completed but it still has an entry in the process table  due to lack of correspondence between the parent and child processes. Usually, a parent process keeps a check on the status of its child processes through the wait() function. When the child process has finished, the wait function signals the parent to completely exit the process from the memory. However, if the parent fails to call the wait function for any of its children, the child process remains alive in the system as a dead or zombie process.
  3. The process that is connected to the terminal is called the foreground job. A job is said to be in the foreground because it can communicate with the user via the screen, and the keyboard. Jobs that are disconnected from the terminal for input and output are called "background" jobs sorting a large file) can be placed in the background
  4. As known a process terminates normally when it finishes its works and exits. While it can also termainate abnormally because of an error or intervention by the user. The owner of the command can use command or a key <ctrl-c> to terminate the process
  5. To cancel a process use the kill command The primary purpose of the kill command is used to send a signal to the process