0

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.
Melebius
  • 11,431
  • 9
  • 52
  • 78
SaTa
  • 996

1 Answers1

1

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 or kill -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 command dpkg -l psmisc which will provide output like this:

$ dpkg -l psmisc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  psmisc                      22.21-2.1build1    amd64              utilities that use the proc file system

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

Elder Geek
  • 36,023
  • 25
  • 98
  • 183