SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
Basics of computer
Basics of computerBasics of computer
Basics of computerAbhijat Arun
 
Operating system 22 threading issues
Operating system 22 threading issuesOperating system 22 threading issues
Operating system 22 threading issuesVaibhav Khanna
 
Basic dos-commands
Basic dos-commandsBasic dos-commands
Basic dos-commandsparag dhok
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating systemMohammad Alam
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systemsvampugani
 
Operating Systems
Operating SystemsOperating Systems
Operating Systemsvampugani
 
Function of Operating system
Function of Operating systemFunction of Operating system
Function of Operating systemAmit Mehla
 
Kernel | Operating System
Kernel | Operating SystemKernel | Operating System
Kernel | Operating SystemSumit Pandey
 
Block diagram of computer 02
Block diagram of computer 02Block diagram of computer 02
Block diagram of computer 02ZTE Nepal
 
File system Os
File system OsFile system Os
File system OsNehal Naik
 
CHAPTER 1= Introduction to Computer
CHAPTER 1= Introduction to ComputerCHAPTER 1= Introduction to Computer
CHAPTER 1= Introduction to ComputerShimels Derso
 
Presentation on Operating System & its Components
Presentation on Operating System & its ComponentsPresentation on Operating System & its Components
Presentation on Operating System & its ComponentsMahmuda Rahman
 
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1abhinav baba
 

Mais procurados (20)

file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
Software and its types
Software and its typesSoftware and its types
Software and its types
 
Basics of computer
Basics of computerBasics of computer
Basics of computer
 
Printer
PrinterPrinter
Printer
 
Operating system 22 threading issues
Operating system 22 threading issuesOperating system 22 threading issues
Operating system 22 threading issues
 
Basic dos-commands
Basic dos-commandsBasic dos-commands
Basic dos-commands
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating system
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Function of Operating system
Function of Operating systemFunction of Operating system
Function of Operating system
 
Storage
StorageStorage
Storage
 
Kernel | Operating System
Kernel | Operating SystemKernel | Operating System
Kernel | Operating System
 
Block diagram of computer 02
Block diagram of computer 02Block diagram of computer 02
Block diagram of computer 02
 
Scheduling
SchedulingScheduling
Scheduling
 
File system Os
File system OsFile system Os
File system Os
 
CHAPTER 1= Introduction to Computer
CHAPTER 1= Introduction to ComputerCHAPTER 1= Introduction to Computer
CHAPTER 1= Introduction to Computer
 
Introduction to Windows XP
Introduction to Windows XPIntroduction to Windows XP
Introduction to Windows XP
 
Presentation on Operating System & its Components
Presentation on Operating System & its ComponentsPresentation on Operating System & its Components
Presentation on Operating System & its Components
 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
 
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1
 

Semelhante a unix- the process states, zombies, running jobs in background

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
 

Semelhante a unix- the process states, zombies, running jobs in background (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
 

Mais de 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
 

Mais de 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
 

Último

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 

Último (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 

unix- the process states, zombies, running jobs in background

  • 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

Notas do Editor

  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