运行 php start.php stop 提示 stop fail
原因:几种可能性 (推荐学习: workerman教程)
第一种可能性:
前提是以debug方式启动的workerman,开发者在终端按了ctrl z给workerman发送了SIGSTOP信号,导致workerman进入后台并挂起(暂停),所以无法响应stop命令(SIGINT信号)。
解决:
在启动workerman的终端输入fg(发送SIGCONT信号)然后回车,将workerman切回前台运行,按ctrl c(发送SIGINT信号)停止workerman。
如果无法停止,尝试运行以下两条命令
killall -9 php ps aux|grep -i workerman|awk '{print $2}'|xargs kill -9
第二种可能性:
运行stop的用户和workerman启动用户不一致,即stop用户没有权限停止workerman。
解决:
切换到启动workerman的用户,或者用权限更高的用户停止workerman。
第三种可能性:
保存workerman主进程pid文件被删除,导致脚本找不到pid进程,导致停止失败。
解决:
将pid文件保存到安全的位置,参见手册Worker::$pidFile。
第四种可能性:
workerman主进程pid文件对应的进程不是workerman进程。
解决:
打开workerman的主进程的pid文件查看主进程pid,pid文件默认在Workerman平行的目录里。
运行命令 ps aux | grep 主进程pid 查看对应的进程是否是Workerman进程,如果不是,可能是服务器重启过,导致workerman保存的pid是过期的pid,而这个pid刚好被其它进程使用,导致停止失败。如果是这种情况,将pid文件删除即可。
The above is the detailed content of worker shutdown failed. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version
SublimeText3 Linux latest version
