Skip to contentSkip to conversation

checkvnc: use netstat to detect running vncserver

PATCH New Joshua Lock 1 participant 1 message Sep 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkvnc: use netstat to detect running vncserver

Using pidof Xvnc isn't sufficient because on debian-based distros the vncserver script will start Xtightvnc.

Instead switch back to using netstat for the VNC tcp socket to detect a running vncserver.

[YOCTO #10257]

---
 bin/checkvnc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/checkvnc +1 -1
index 728031f..d934dfa 100755
@@ -2,7 +2,7 @@
 #
 # check if vnc server is running, and if not, cleanup and restart
 #
-pid=$(pidof Xvnc)
+netstat -tnl | grep :5901 > /dev/null
 if [ $? != 0 ]; then
     echo "Xvnc not running, attempting restart"
     vncserver -kill :1
Signature · 1 line
2.7.4