Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6934557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:58:32+00:00 2026-05-27T11:58:32+00:00

So when a child dies parent gets SIGCHLD but if parent dies before doing

  • 0

So when a child dies parent gets SIGCHLD but if parent dies before doing wait(), the child is reparented to init. At this point in time the child is a zombie i.e. <defunct>.

What happens next?

Does init do wait() on that child? if yes, when does it do it? Any guarantees regarding time-limit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:58:33+00:00Added an answer on May 27, 2026 at 11:58 am

    Yes, init will immediately reap all children. If you make a process which ignores SIGCHLD and accumulates many zombies you can get rid of them by killing that parent via the mechanism you describe.

    For reference here is the main loop of init while in multi user mode. requested_transition is set by signalling init (e.g. the classic kill -1 1 to read an updated inittab):

        while (!requested_transition)
                if ((pid = waitpid(-1, (int *) 0, 0)) != -1)
                        collect_child(pid);
    

    (collect_child handles cases where init has some special interest in the process, such as a login shell which now needs a new getty)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have child class,the child class inherits all methods from the parent,but how
A child class can access protected functions in parent class,but the parent class can't
Child threads sleeps to wait condition, and the parent thread can call some routine
Why Child class doesn't have echo() method? Parent = function(){ this.name = 'abc'; }
//child process char buf[20]; read(fd[0][0], buf, 20); printf(%s, buf); //parent process write(fd[0][1], 12, 20);
I get child properties of an object with this code, PropertyDescriptorCollection childProperties = TypeDescriptor.GetProperties(theObject)[childNode.Name].GetChildProperties();
Suppose both parent and child use one pipe for writing and reading means when
I have a Parent/Child object/mapping as follows: class Parent { int Id; string name;
my CSS code .child{ width:100px; height:100px; display:inline-block; } my HTML code <div id=parent> <div
I have two classes with a parent-child relationship (customer&order directory&file etc) I have typedef

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.