#!/bin/sh

#
# This file was generated by Chef.
# Do NOT modify this file by hand.
#


<% groups = ([node['jenkins']['master']['user']] + node['jenkins']['master']['runit']['groups']).join(':') %>
exec 2>&1
cd <%= node['jenkins']['master']['home'] %>
touch jenkins.start
<% limits = node['jenkins']['master']['ulimits'] %>
<% if limits && !limits.empty? %>
ulimit <% limits.each { |option, value| %>-<%= option %> <%= value %> <% } %>
<% end %>
exec chpst -u <%= groups %> -U <%= groups %> \
  env HOME=<%= node['jenkins']['master']['home'] %> \
  JENKINS_HOME=<%= node['jenkins']['master']['home'] %> \
  <%= node['jenkins']['java'] %> <%= node['jenkins']['master']['jvm_options'] %> -jar jenkins.war \
  --httpPort=<%= node['jenkins']['master']['port'] %> \
  --httpListenAddress=<%= node['jenkins']['master']['listen_address'] %> \
  <%= node['jenkins']['master']['jenkins_args'] %>

#!/bin/sh

#
# This file was generated by Chef.
# Do NOT modify this file by hand.
#

[ -r /etc/profile ] && . /etc/profile

<% groups = ([node['jenkins']['master']['user']] + node['jenkins']['master']['runit']['groups']).join(':') %>
exec 2>&1
cd <%= node['jenkins']['master']['home'] %>
touch jenkins.start
<% limits = node['jenkins']['master']['ulimits'] %>
<% if limits && !limits.empty? %>
ulimit <% limits.each { |option, value| %>-<%= option %> <%= value %> <% } %>
<% end %>
exec chpst -u <%= groups %> -U <%= groups %> \
  env HOME=<%= node['jenkins']['master']['home'] %> \
  JENKINS_HOME=<%= node['jenkins']['master']['home'] %> \
  <%= node['jenkins']['java'] %> <%= node['jenkins']['master']['jvm_options'] %> -jar jenkins.war \
  --httpPort=<%= node['jenkins']['master']['port'] %> \
  --httpListenAddress=<%= node['jenkins']['master']['listen_address'] %> \
  <%= node['jenkins']['master']['jenkins_args'] %>

Allow Jenkins to read system environment variables
Allow Jenkins to read system environment variables

Without the proposed change, we cannot read user-defined variables. This is particularly useful to define passwords (/etc/profile.d/mypasswords.sh), for example, and read them on jenkins jobs.