2

I cannot kill redis-server no matter how many times I've tried.

ps -ef | grep redis-server gives

root 10592 1 0 01:10 ? 00:00:00 /snap/redis/658/usr/bin/redis-server *:6379

root 10846 8813 0 01:12 pts/1 00:00:00 grep --color=auto redis-server

I have tried:

  • Using kill -9 [pid]
  • Using service redis-server stop (in normal user with sudo and while in sudo su - root)
  • Using /etc/init.d/redis-server stop
  • Using redis-cli and then running shutdown SAVE or shutdown NOSAVE in the CLI
  • Using systemctl stop redis-server

No matter what I do, the server just restarts with a different PID. Can somebody tell me what the hell is going on? Yesterday, I never even installed redis on my Ubuntu. Today, after installing redis-cli, suddenly redis runs on boot, and is unkillable. What the hell is going on? How do I kill it? Why does it behave this way?

Note: I'm on Ubuntu 22.

  • It's a snap. If you don't need it you can uninstall it using `sudo snap remove redis-server`. – vidarlo Dec 30 '22 at 18:47
  • Ok, but why does it keep on restarting when I use snap? What's the reason behind that? Why is it unkillable through snap? – Shaundavin13 Dec 30 '22 at 18:58
  • Possibly something else that you want depends on it. – vidarlo Dec 30 '22 at 19:00
  • Hm, not sure that's the case since I just installed it 2 days ago. Anyway, turns out `sudo snap stop redis` finally stops it. Don't know why snap processes are immune to normal kill commands. – Shaundavin13 Dec 30 '22 at 19:02

1 Answers1

1

Ok it turns out, snap uses a different system for maintaining processes vs regular systemctl. Snap apparently also allows you to start/stop processes, so you can use sudo snap stop redis to stop the redis server from snap.