Skip to content

Commit

Permalink
[FIXED JENKINS-11366] Jenkins takes up too much space in /var/run
Browse files Browse the repository at this point in the history
Use /var/cache/jenkins to hold the unpacked jenkins.war file at runtime.
  • Loading branch information
oldelvet authored and kohsuke committed Nov 30, 2011
1 parent 487b945 commit 9714917
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -79,6 +79,9 @@
<li class=bug>
Debian/Ubuntu init script does not wait long enough during stop operation
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11744">issue 11744</a>)
<li class=bug>
Jenkins takes up too much space in /var/run
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11366">issue 11366</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
3 changes: 3 additions & 0 deletions debian/debian/dirs
Expand Up @@ -11,3 +11,6 @@ var/run/jenkins
# Store jenkins log file in it's own directory since they can become rather large and in the future
# rotating logs can be easily added.
var/log/jenkins

# Cache directory for the unpacked jenkins.war file.
var/cache/jenkins
2 changes: 1 addition & 1 deletion debian/debian/jenkins.default
Expand Up @@ -51,4 +51,4 @@ AJP_PORT=-1
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
JENKINS_ARGS="--webroot=/var/run/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"
JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"
8 changes: 5 additions & 3 deletions debian/debian/jenkins.postinst
Expand Up @@ -47,9 +47,11 @@ case "$1" in
# we don't do "chmod 750" so that the user can choose the pemission for g and o on their own
chmod u+rwx /var/lib/jenkins /var/log/jenkins

# make sure jenkins can delete everything in /var/run/jenkins to re-explode war
chown -R jenkins:adm /var/run/jenkins
chmod -R 750 /var/run/jenkins
# make sure jenkins can delete everything in /var/cache/jenkins to
# re-explode war. older installations may use /var/run/jenkins
# so make sure that they can delete too.
chown -R jenkins:adm /var/cache/jenkins /var/run/jenkins
chmod -R 750 /var/cache/jenkins /var/run/jenkins
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
3 changes: 2 additions & 1 deletion debian/debian/jenkins.postrm
Expand Up @@ -5,7 +5,8 @@ set -e
case "$1" in
purge)
userdel jenkins || true
rm -rf /var/lib/jenkins /var/log/jenkins /var/run/jenkins
rm -rf /var/lib/jenkins /var/log/jenkins \
/var/run/jenkins /var/cache/jenkins
;;

remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
Expand Down

0 comments on commit 9714917

Please sign in to comment.