This seems like it should be simple, but I can't seem to find out how to do this. I have an x11vnc server running on Ubuntu 20.04 inside a docker container, and I want to stop the x11vnc server so I can then start it as a non-root user. The x11vnc server was started with the -forever argument, and I suspect that's why killing it with kill -9 [PROCESS_ID] simply results in it restarting itself automatically.
Googling how to stop it just returns a gazillion results on how to prevent it from stopping, but I want the opposite.
Is there a simple way to stop this? I don't care about restarting it. I just want it to stop.
killcommand takes process IDs, not port numbers as parameters. You may have simply misaimed your kill command. And sincekill -9is a direct order for the OS kernel to "stop giving any more CPU time to this process and clean it up forcibly", the only way to escape it would be to have another process restart the killed one, and vice versa.