Bug 8210

Summary: Should be able to restart a crashed vnc server
Product: [Infrastructure] AutoBuilder Reporter: Ross Burton <ross.burton>
Component: autobuilderAssignee: Bill Randle <bill.randle>
Status: RESOLVED FIXED QA Contact: Tracy Graydon <tracy.graydon>
Severity: normal    
Priority: Medium+ CC: elizabeth.flanagan, infras.ab.watcher, Infras.watcher, richard.purdie, sgw
Version: unspecified   
Target Milestone: 2.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2015-08-26 11:43:56 UTC
If the VNC server segfaults the sanity test script can't start a new one because the lock file still exists:

Warning: ubuntu1204:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server ubuntu1204:1
A VNC server is already running as :1

I suggest that if the socket isn't open, the lock file should be deleted before starting the VNC server.

Also the netstat invocation can be improved as netstat -an|grep 5901 will match a unix socket open on /tmp/lolo5901lolol.   netstat -tnl | grep :5901 will have less false positives.
Comment 1 Richard Purdie 2015-09-03 15:46:04 UTC
I'd propose adding a script to the autobuilder somewhere in PATH which handles setting up VNC. The actual tasks can then just call the script to ensure its setup there rather than putting all this logic in the tasks.
Comment 2 Bill Randle 2016-08-17 00:11:07 UTC
Created a script to check for a running vnc server, and if not running cleanup dangling lock files and restart the server. Invoke the script from the various sanity test build steps.

Patch submitted to mailing list.
Comment 3 Bill Randle 2016-09-04 15:58:47 UTC
Patch merged to master by Joshua on 8/31.