Closed xenion54 closed 5 months ago
as workaround, now using
$master_pid = file_get_contents(\Workerman\Worker::$pidFile);
unlink(\Workerman\Worker::$pidFile);
posix_kill($master_pid, SIGKILL);
The meaning of \Workerman\Worker::stopAll() is to stop all worker instances of the current process. If it runs in a child process, this means stopping the current child process. If you want to stop all processes, you can use posix_kill(posix_getppid(), SIGINT);
.
The meaning of \Workerman\Worker::stopAll() is to stop all worker instances of the current process. If it runs in a child process, this means stopping the current child process. If you want to stop all processes, you can use
posix_kill(posix_getppid(), SIGINT);
.
Thx for answer. It looks better, than my workaround. Maby add Workerman::stopParent() method with this realization?
Intuitively, when I call the stopAll method, I expect everyone, including the parent process, to be stopped. Can you adjust the behavior of the application? Like if its child process, call "posix_kill(posix_getppid(), SIGINT);"
In order to be compatible with older versions, I am unable to adjust the behavior of Worker::stopAll(). Perhaps in the future, we may consider adding an interface similar to stopParent().
In linux, this code not killing worker
How to kill him from inside?