A process can finish by returning from its main function, calling an exit interface, or being terminated by a signal. The kernel releases most of its resources, but parent-child accounting continues until the parent collects the termination information.
Processes · Lesson 5
Process Termination
Learn how exit status, waiting, zombies, and reparenting complete the Linux process lifecycle.