I use x0vncserver to connect to my ubuntu display. I start it with /usr/bin/x0vncserver -display :0
. I can see it running with pidof x0vncserver
.
I have also seen that the proper way to stop vncserver is to use vncserver -kill :xx
command.
Is there a similar command to properly stop x0vncserver or one should just use killall x0vncserver
to stop it?
When trying sudo systemctl stop x0vncserver
, I got:
Failed to stop x0vncserver.service: Unit x0vncserver.service not loaded.
It looks like killing by PID is the way to go.
First obtain the PID:
pidof x0vncserver
Then kill it with the resulting PID from the above command.
kill -15 PID
orkill -SIGTERM PID
You can also use
killall processname
where process name is the process you wish to kill provided you have the psmisc package installed. You can confirm that with the commanddpkg -l psmisc
which will provide output like this:Sources: https://groups.google.com/forum/#!topic/tigervnc-users/lxRS20r2XFc
https://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/
man killall