jenkins 3.94 KB
Newer Older
Mattia Rizzolo's avatar
Mattia Rizzolo committed
1
# defaults for Jenkins automation server
2
3
4
5
6
7
8

# pulled in from the init script; makes things easier.
NAME=jenkins

# location of java
JAVA=/usr/bin/java

9
10
11
# jenkins home location
JENKINS_HOME=/var/lib/$NAME

12
# arguments to pass to java
13

14
15
16
# Allow graphs etc. to work even when an X server is present
JAVA_ARGS="-Djava.awt.headless=true"

17
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address
18
# See some recommendation from https://jenkins.io/blog/2016/11/21/gc-tuning/
19
JAVA_ARGS="$JAVA_ARGS -Xms20G -Xmx20G"  # heap settings
20
21
22
23
24
25
26
27
28
JAVA_ARGS="$JAVA_ARGS -server -XX:+AlwaysPreTouch"
# store heap dumps in case of OOM, to investigate it later
JAVA_ARGS="$JAVA_ARGS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$JENKINS_HOME/heapDumps/"
# GC logging, in case somebody ever wants to actually finely tune the GC for us...
JAVA_ARGS="$JAVA_ARGS -Xloggc:$JENKINS_HOME/javaGC/gc-%t.log -XX:NumberOfGCLogFiles=5"
JAVA_ARGS="$JAVA_ARGS -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m -XX:+PrintGC"
JAVA_ARGS="$JAVA_ARGS -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC"
JAVA_ARGS="$JAVA_ARGS -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy"
# G1 GC settings
29
JAVA_ARGS="$JAVA_ARGS -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication"
Holger Levsen's avatar
Holger Levsen committed
30
JAVA_ARGS="$JAVA_ARGS -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=10 -XX:+UnlockDiagnosticVMOptions -XX:G1SummarizeRSetStatsPeriod=1"
31
# h01ger trying stuff
Holger Levsen's avatar
Holger Levsen committed
32
export MALLOC_ARENA_MAX=1
33

34
35
36
# make jenkins listen on IPv4 address
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true"

Holger Levsen's avatar
Holger Levsen committed
37
PIDFILE=/var/run/$NAME/$NAME.pid
38

39
# user and group to be invoked as (default to jenkins)
Holger Levsen's avatar
Holger Levsen committed
40
41
JENKINS_USER=$NAME
JENKINS_GROUP=$NAME
42
43

# location of the jenkins war file
Holger Levsen's avatar
Holger Levsen committed
44
JENKINS_WAR=/usr/share/$NAME/$NAME.war
45

46
# set this to false if you don't want Jenkins to run by itself
47
48
49
50
51
# in this set up, you are expected to provide a servlet container
# to host jenkins.
RUN_STANDALONE=true

# log location.  this may be a syslog facility.priority
Holger Levsen's avatar
Holger Levsen committed
52
53
JENKINS_LOG=/var/log/$NAME/$NAME.log
#JENKINS_LOG=daemon.info
54

55
56
57
58
# Whether to enable web access logging or not.
# Set to "yes" to enable logging to /var/log/$NAME/access_log
JENKINS_ENABLE_ACCESS_LOG="no"

59
60
61
62
63
# OS LIMITS SETUP
#   comment this out to observe /etc/security/limits.conf
#   this is on by default because http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835a3e92e
#   reported that Ubuntu's PAM configuration doesn't include pam_limits.so, and as a result the # of file
#   descriptors are forced to 1024 regardless of /etc/security/limits.conf
64
MAXOPENFILES=131071 # limit is 65535 on i386
65

66
# set the umask to control permission bits of files that Jenkins creates.
Holger Levsen's avatar
Holger Levsen committed
67
68
69
70
71
72
73
74
75
76
77
#   027 makes files read-only for group and inaccessible for others, which some security sensitive users
#   might consider benefitial, especially if Jenkins runs in a box that's used for multiple purposes.
#   Beware that 027 permission would interfere with sudo scripts that run on the master (JENKINS-25065.)
#
#   Note also that the particularly sensitive part of $JENKINS_HOME (such as credentials) are always
#   written without 'others' access. So the umask values only affect job configuration, build records,
#   that sort of things.
#
#   If commented out, the value from the OS is inherited,  which is normally 022 (as of Ubuntu 12.04,
#   by default umask comes from pam_umask(8) and /etc/login.defs

78
UMASK=022
79

80
81
82
83
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080


84
# servlet context, important if you want to use apache proxying
Holger Levsen's avatar
Holger Levsen committed
85
PREFIX=/$NAME
86
87
88

# arguments to pass to jenkins.
# --javahome=$JAVA_HOME
89
# --httpListenAddress=$HTTP_HOST (default 0.0.0.0)
90
91
92
93
94
95
96
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.roles.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
# --prefix=$PREFIX

Holger Levsen's avatar
Holger Levsen committed
97
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT"