Skip to main content
deleted 2 characters in body
Source Link
Stéphane Chazelas
  • 586.2k
  • 96
  • 1.1k
  • 1.7k

A parent process should always be running with N children process.

I would like to run a script which will show/kill all children processes that don't have a parent process.

ps faux | grep name

 root 37140 0.3 0.1 61160 724 /process.pl [child] root 22079 10.2 0.3 127332 64620 /process.pl [master] root 22081 0.3 0.1 84752 26084 \_ /process.pl [child] $ ps faux | grep process.pl root 37140 0.3 0.1 61160 724 /process.pl [child] root 22079 10.2 0.3 127332 64620 /process.pl [master] root 22081 0.3 0.1 84752 26084 \_ /process.pl [child] 

A parent process should always be running with N children process.

I would like to run a script which will show/kill all children processes that don't have a parent process.

ps faux | grep name

 root 37140 0.3 0.1 61160 724 /process.pl [child] root 22079 10.2 0.3 127332 64620 /process.pl [master] root 22081 0.3 0.1 84752 26084 \_ /process.pl [child] 

A parent process should always be running with N children process.

I would like to run a script which will show/kill all children processes that don't have a parent process.

$ ps faux | grep process.pl root 37140 0.3 0.1 61160 724 /process.pl [child] root 22079 10.2 0.3 127332 64620 /process.pl [master] root 22081 0.3 0.1 84752 26084 \_ /process.pl [child] 
Source Link
bbaja42
  • 2.8k
  • 2
  • 18
  • 16

How to kill all processes that don't have specific parent process?

A parent process should always be running with N children process.

I would like to run a script which will show/kill all children processes that don't have a parent process.

ps faux | grep name

 root 37140 0.3 0.1 61160 724 /process.pl [child] root 22079 10.2 0.3 127332 64620 /process.pl [master] root 22081 0.3 0.1 84752 26084 \_ /process.pl [child]