Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265751 - Hudson cannot run vncserver for headless UI tests
Summary: Hudson cannot run vncserver for headless UI tests
Status: RESOLVED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Servers (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-21 21:17 EST by Nick Boldt CLA
Modified: 2009-02-23 15:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Boldt CLA 2009-02-21 21:17:06 EST
In order to wrap UI tests within a single xvnc UI thread, Hudson needs to be able to start vncserver before a build, then take it down when done. I'm guessing the hudson user doesn't have permission to run vncserver?

I guess all we need here is that root sudo's to hudson, runs `vncserver :10` to set an initial vncserver password, and then kills that session (`vncserver -kill :10`). Once the password is set, everyone should be able to create/destroy sessions as part of builds.

Starting xvnc
[workspace] $ vncserver :10
vncserver: Could not create /root/.vnc.
FATAL: Failed to run 'vncserver :10' (exit code 13), blacklisting display #10; consider adding to your Hudson launch script: killall Xvnc; rm -fv /tmp/.X*-lock /tmp/.X11-unix/X*
java.io.IOException: Failed to run 'vncserver :10' (exit code 13), blacklisting display #10; consider adding to your Hudson launch script: killall Xvnc; rm -fv /tmp/.X*-lock /tmp/.X11-unix/X*
	at hudson.plugins.xvnc.Xvnc.setUp(Xvnc.java:61)
	at hudson.model.Build$RunnerImpl.doRun(Build.java:131)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:269)
	at hudson.model.Run.run(Run.java:865)
	at hudson.model.Build.run(Build.java:112)
	at hudson.model.ResourceController.execute(ResourceController.java:93)
	at hudson.model.Executor.run(Executor.java:113)

The only caveat here is that the sessions will all share the same password, which means it should be kept secret. Should a session get stuck (eg., a runaway UI test waiting for a modal dialog), processes can be killed by request of the webmaster (either as root via kill / pkill, or by connecting to the vnc session and killing the process as hudson).
Comment 1 Denis Roy CLA 2009-02-22 08:34:23 EST
Is this somehow related to bug 265750?  Should I just restart Hudson as proposed there?
Comment 2 Nick Boldt CLA 2009-02-22 13:18:50 EST
(In reply to comment #1)
> Is this somehow related to bug 265750?  Should I just restart Hudson as
> proposed there?

Well, they're related. You don't want vnc running as root or people would be able to connect as root. 

So, yes, Hudson has to run as hudsonbuild, and hudsonbuild needs to set up its ~/.vnc* stuff so that a password is assigned for vnc connections.
Comment 3 Eclipse Webmaster CLA 2009-02-23 15:25:56 EST
This was related to bug 265750, the $HOME variable was not set correctly(inherited the root value), so it couldn't create the needed files.  I've corrected that and with Nicks help have been able to at least get xvnc started.

-M.