2

Trying to get some jobs working that require xvnc, but get this:

  Starting xvnc
  [workspace] $ vncserver :14
  vncserver: The HOME environment variable is not set.

I have no problems with running vncserver from the jenkins user on command line. (aside: 'printenv' shows the HOME variable is populated correctly when on the command line, but not from within a jenkins job).

I am running Ubuntu 11.10.

CasualT
  • 4,869
  • 1
  • 31
  • 53
  • I don't usually run jenkins (because it launches automatically, with upstart I believe), but when I do, I use: "start jenkins". :) – CasualT Jul 12 '12 at 00:38

2 Answers2

1

Edit /etc/init.d/jenkins on the server to set HOME environment variable.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • I was thinking about doing that...but wasn't super familiar with the upstart job aspect of it. Should I just do 'export HOME=/var/lib/jenkins' right at the very start? – CasualT Jul 12 '12 at 19:53
  • Here is [an example](https://wiki.jenkins-ci.org/display/JENKINS/JenkinsLinuxStartupScript) – malenkiy_scot Jul 12 '12 at 20:54
  • take back, that does not do the trick. The script in question is 'old', and doesn't use upstart. :( – CasualT Jul 12 '12 at 23:34
  • Sorry, not familiar with upstart, but it looks that you've got the idea - find the configuration file and set the variable in it. – malenkiy_scot Jul 13 '12 at 04:25
1

Go into: /etc/init/jenkins.conf

Add the following line to the bottom of the env list.

env HOME="/var/lib/jenkins"

restart jenkins, enable the xvnc in your build, and then it will work.

CasualT
  • 4,869
  • 1
  • 31
  • 53