Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.39k stars 2.61k forks source link

treekill syntax incompatible with freebsd #5895

Open skeyby opened 6 days ago

skeyby commented 6 days ago

What's going wrong?

On FreeBSD when you stop a process that has some childs, the child process won't get stopped

How could we reproduce this issue?

Just start any forking process in PM2

Supporting information

Problem is in lib/TreeKill.js -- the default case is the linux syntax that is not working under FreeBSD (there's no --ppid switch on FreeBSD).

The solution is to use Darwin command line (pgrep) also for FreeBSD.