File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2076,13 +2076,21 @@ impl StatusManager {
20762076 /// other than the recorded PID itself. A wrapper shell can exit while the real worker keeps
20772077 /// running (reparented to PID 1 but retaining the original group); in that case the recorded
20782078 /// PID reads as a zombie even though the service is genuinely healthy.
2079+ ///
2080+ /// This only applies when the recorded PID is its own process-group leader (`pid == pgid`),
2081+ /// which systemg guarantees for service wrappers via `setpgid(0, 0)`. A bare process that
2082+ /// merely inherited an unrelated group (e.g. the supervisor's own) is a genuine zombie.
20792083 #[ cfg( target_os = "linux" ) ]
20802084 fn process_group_has_live_member ( pid : u32 ) -> bool {
20812085 let Ok ( pgid) = getpgid ( Some ( Pid :: from_raw ( pid as i32 ) ) ) else {
20822086 return false ;
20832087 } ;
20842088 let pgid = pgid. as_raw ( ) ;
20852089
2090+ if pgid != pid as i32 {
2091+ return false ;
2092+ }
2093+
20862094 let Ok ( entries) = fs:: read_dir ( "/proc" ) else {
20872095 return false ;
20882096 } ;
You can’t perform that action at this time.
0 commit comments