Question: Write a C program that searches for defunct process/es in a process tree rooted at a specified process and forcefully terminates the parent process/es based
Write a C program that searches for defunct process/es in a process tree rooted at a specified process and forcefully terminates the parent process/es based on the input parameters. Synopsis: ztree [root_process] [OPTION1] [OPTION2] o Forcefully terminates all the parent processes (except BASH) of defunct processes that belong to the process tree rooted at root_process and prints the PIDs of the terminated process/es o root_process is the PID of a process that is a descendant of a current bash process. OPTION1 o - t forcefully terminates parent processes (whose elapsed time is greater than PROC_ELTIME) of all the defunct processes in the process tree rooted at root_process o - b forcefully terminates all the processes in the process tree rooted at root_process that have >= NO_OF_DFCS defunct child processes. OPTION2 o PROC_ELTIME The elapsed time of the process in minutes since it was created (>=1) o NO_OF_DFCS The number of defunct child processes (>=1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
