summaryrefslogtreecommitdiffstats
path: root/hosts/jenkins/etc/init.d
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@debian.org>2016-09-08 15:23:28 +0000
committerMattia Rizzolo <mattia@debian.org>2016-09-08 15:23:28 +0000
commit6f7a081d9f2c37532ce0c7f2e83a4224fc2440b5 (patch)
treec1d6df06c27d2dfe5f0a56e64f63f7a923ec5667 /hosts/jenkins/etc/init.d
parent272ba8a6cc480c2f185221ebe7e6e4ec923f8804 (diff)
downloadjenkins.debian.net-6f7a081d9f2c37532ce0c7f2e83a4224fc2440b5.tar.xz
instruct java to store heap dumps in case of OOM
Diffstat (limited to 'hosts/jenkins/etc/init.d')
-rwxr-xr-xhosts/jenkins/etc/init.d/jenkins5
1 files changed, 5 insertions, 0 deletions
diff --git a/hosts/jenkins/etc/init.d/jenkins b/hosts/jenkins/etc/init.d/jenkins
index 2714eb13..4b266c45 100755
--- a/hosts/jenkins/etc/init.d/jenkins
+++ b/hosts/jenkins/etc/init.d/jenkins
@@ -92,6 +92,11 @@ check_tcp_port() {
#
do_start()
{
+ # java will store heap dumps here in case of OutOfMemoryError.
+ # delete old heap dumps when starting
+ rm -r "$JENKINS_HOME/heapDumps/" > /dev/null 2>&1 || true
+ mkdir -p "$JENKINS_HOME/heapDumps/"
+ chown ${JENKINS_USER}.${JENKINS_GROUP} "$JENKINS_HOME/heapDumps"
# the default location is /var/run/jenkins/jenkins.pid but the parent directory needs to be created
mkdir `dirname $PIDFILE` > /dev/null 2>&1 || true
chown $JENKINS_USER `dirname $PIDFILE`