cannot kill redis-server on linux
Asked Answered
P

1

1

No matter what I do I can't seem to kill redis without another instance popping up immediately with a different PID -- I checked to make sure I was killing the parent process and I was. Any suggestions?? I've already tried restarting my machine. I've also tried the answers from this SO post. Here are the commands I ran to kill and check:

ascourtas@ascourtas-VirtualBox:~$ ps -ef | grep redis
redis     2573     1  0 12:11 ?        00:00:00 /usr/bin/redis-server 
0.0.0.0:6379
ascourt+  2991  2501  0 12:25 pts/6    00:00:00 grep --color=auto 
redis

ascourtas@ascourtas-VirtualBox:~$ pgrep redis | xargs -i pstree -ps 
{}
systemd(1)───redis-server(2573)─┬─{redis-server}(2575)
                            └─{redis-server}(2576)

ascourtas@ascourtas-VirtualBox:~$ sudo kill -9 2573

ascourtas@ascourtas-VirtualBox:~$ ps -ef | grep redis
redis     3069     1  0 12:26 ?        00:00:00 /usr/bin/redis-server 
0.0.0.0:6379
ascourt+  3077  2501  0 12:26 pts/6    00:00:00 grep --color=auto 
redis
Papal answered 5/6, 2018 at 16:33 Comment(6)
pkill -9 redis for soft kill of redis processesCoolish
Looks more like a sysadmin question than a programming one - try Server Fault instead.Ezequiel
Possible duplicate of How can I stop redis-server?Hills
@Roshan I tried that and it did not work :/Papal
@julekgwa those solutions also did not work for mePapal
thanks @julekgwa! it turns out I hadn't run the command in that post correctlyPapal
P
7

Figured it out! Turns out when I had tried the second answer provided at this SO post, I had done cd /etc/init.d and then ran redis-server stop, when I actually should've run /etc/init.d/redis-server stop. I do not know why this matters though.

Papal answered 5/6, 2018 at 17:4 Comment(2)
Thank you for this Q&A, really useful. I had made the exact same error when following the SO post. Also no other method seem to work for me. If you ever find out the reason behind this, or anything more about this topic, please consider updating the answer.Jenette
I definitely will! Although I have not yet been enlightened. I'm glad it was helpful for you!Papal

© 2022 - 2024 — McMap. All rights reserved.