无法杀死 Linux 上的 redis-server

asc*_*tas 1 linux kill process redis redis-server

无论我做什么,我似乎都无法在没有立即弹出另一个具有不同 PID 的实例的情况下杀死 Redis ——我检查以确保我正在杀死父进程,而且确实如此。有什么建议么??我已经尝试过重新启动我的机器。我也尝试过这篇 SO post的答案。以下是我运行的杀死和检查命令:

\n\n
ascourtas@ascourtas-VirtualBox:~$ ps -ef | grep redis\nredis     2573     1  0 12:11 ?        00:00:00 /usr/bin/redis-server \n0.0.0.0:6379\nascourt+  2991  2501  0 12:25 pts/6    00:00:00 grep --color=auto \nredis\n\nascourtas@ascourtas-VirtualBox:~$ pgrep redis | xargs -i pstree -ps \n{}\nsystemd(1)\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80redis-server(2573)\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80{redis-server}(2575)\n                            \xe2\x94\x94\xe2\x94\x80{redis-server}(2576)\n\nascourtas@ascourtas-VirtualBox:~$ sudo kill -9 2573\n\nascourtas@ascourtas-VirtualBox:~$ ps -ef | grep redis\nredis     3069     1  0 12:26 ?        00:00:00 /usr/bin/redis-server \n0.0.0.0:6379\nascourt+  3077  2501  0 12:26 pts/6    00:00:00 grep --color=auto \nredis\n
Run Code Online (Sandbox Code Playgroud)\n

asc*_*tas 7

弄清楚了!事实证明,当我尝试了这篇文章中提供的第二个答案时,我已经完成了cd /etc/init.d然后运行redis-server stop,而实际上我应该运行/etc/init.d/redis-server stop。我不知道为什么这很重要。