summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2014-10-21 08:38:20 +0000
committerTony Vroon <chainsaw@gentoo.org>2014-10-21 08:38:20 +0000
commit00776f718bfa407bd96a2ff7f4a78555d09090e4 (patch)
tree330d9ed81bbc16028ed26d246e7b3faab2b7bb81 /dev-util
parentRemove old development versions (diff)
downloadgentoo-2-00776f718bfa407bd96a2ff7f4a78555d09090e4.tar.gz
gentoo-2-00776f718bfa407bd96a2ff7f4a78555d09090e4.tar.bz2
gentoo-2-00776f718bfa407bd96a2ff7f4a78555d09090e4.zip
Logrotate snippet as written by Travis Hansen in bug #526166. Stop attempting to create a /var/run directory structure, those sands have shifted. Enhance init script to create home directory if missing. Do not assign the jenkins user a shell as it is not needed, as per Agostino "ago" Sarubbo on #gentoo-dev. Remove older revision.
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A)
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/jenkins-bin/ChangeLog13
-rw-r--r--dev-util/jenkins-bin/files/jenkins-bin.init252
-rw-r--r--dev-util/jenkins-bin/files/jenkins-bin.logrotate17
-rw-r--r--dev-util/jenkins-bin/jenkins-bin-1.584-r1.ebuild (renamed from dev-util/jenkins-bin/jenkins-bin-1.584.ebuild)14
4 files changed, 89 insertions, 7 deletions
diff --git a/dev-util/jenkins-bin/ChangeLog b/dev-util/jenkins-bin/ChangeLog
index 6e467f3937e2..0578fb01d43a 100644
--- a/dev-util/jenkins-bin/ChangeLog
+++ b/dev-util/jenkins-bin/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for dev-util/jenkins-bin
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/ChangeLog,v 1.2 2014/10/20 23:18:28 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/ChangeLog,v 1.3 2014/10/21 08:38:20 chainsaw Exp $
+
+*jenkins-bin-1.584-r1 (21 Oct 2014)
+
+ 21 Oct 2014; Tony Vroon <chainsaw@gentoo.org> -jenkins-bin-1.584.ebuild,
+ +jenkins-bin-1.584-r1.ebuild, +files/jenkins-bin.init2,
+ +files/jenkins-bin.logrotate:
+ Logrotate snippet as written by Travis Hansen in bug #526166. Stop attempting
+ to create a /var/run directory structure, those sands have shifted. Enhance
+ init script to create home directory if missing. Do not assign the jenkins
+ user a shell as it is not needed, as per Agostino "ago" Sarubbo on
+ #gentoo-dev. Remove older revision.
20 Oct 2014; Manuel Rüger <mrueg@gentoo.org> jenkins-bin-1.584.ebuild:
Fix install.
diff --git a/dev-util/jenkins-bin/files/jenkins-bin.init2 b/dev-util/jenkins-bin/files/jenkins-bin.init2
new file mode 100644
index 000000000000..9e326a569350
--- /dev/null
+++ b/dev-util/jenkins-bin/files/jenkins-bin.init2
@@ -0,0 +1,52 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+checkconfig() {
+ if [ ! -n "$JENKINS_HOME" ] ; then
+ eerror "JENKINS_HOME not configured"
+ return 1
+ fi
+ if [ ! -d "$JENKINS_HOME" ] ; then
+ checkpath -q -d -o jenkins:jenkins -m 0755 "$JENKINS_HOME" || return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ JAVA_HOME=`java-config --jre-home`
+ COMMAND=$JAVA_HOME/bin/java
+
+ JAVA_PARAMS="$JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
+
+ # Don't use --daemon here, because in this case stop will not work
+ PARAMS="--logfile=/var/log/jenkins/jenkins.log"
+ [ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT"
+ [ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL"
+ [ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP"
+ [ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
+ [ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
+ [ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS"
+
+ if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
+ PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log"
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile $JENKINS_PIDFILE \
+ --user ${JENKINS_USER} \
+ --exec "${COMMAND}" -- $JAVA_PARAMS $PARAMS
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --pidfile $JENKINS_PIDFILE
+ eend $?
+}
diff --git a/dev-util/jenkins-bin/files/jenkins-bin.logrotate b/dev-util/jenkins-bin/files/jenkins-bin.logrotate
new file mode 100644
index 000000000000..1a9497aa02a4
--- /dev/null
+++ b/dev-util/jenkins-bin/files/jenkins-bin.logrotate
@@ -0,0 +1,17 @@
+/var/log/jenkins/jenkins.log /var/log/jenkins/access_log {
+ compress
+ dateext
+ maxage 365
+ rotate 99
+ size=+4096k
+ notifempty
+ missingok
+ create 644
+ postrotate
+ [ -r /etc/conf.d/jenkins ] && source /etc/conf.d/jenkins
+ if [ -s /var/run/jenkins/jenkins.pid ]; then
+ JPID=`cat /var/run/jenkins/jenkins.pid`
+ test -n "`find /proc/$JPID -maxdepth 0 -user ${RUN_AS:-jenkins} 2>/dev/null`" && kill -s ALRM $JPID || :
+ fi
+ endscript
+}
diff --git a/dev-util/jenkins-bin/jenkins-bin-1.584.ebuild b/dev-util/jenkins-bin/jenkins-bin-1.584-r1.ebuild
index e5fd7fdd2084..381b4caea003 100644
--- a/dev-util/jenkins-bin/jenkins-bin-1.584.ebuild
+++ b/dev-util/jenkins-bin/jenkins-bin-1.584-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/jenkins-bin-1.584.ebuild,v 1.2 2014/10/20 23:18:28 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/jenkins-bin-1.584-r1.ebuild,v 1.1 2014/10/21 08:38:20 chainsaw Exp $
EAPI=5
@@ -23,18 +23,20 @@ S=${WORKDIR}
pkg_setup() {
enewgroup jenkins
- enewuser jenkins -1 /bin/bash /var/lib/jenkins jenkins
+ enewuser jenkins -1 /sbin/nologin /var/lib/jenkins jenkins
}
src_install() {
- keepdir /var/run/jenkins /var/log/jenkins
- keepdir /var/lib/jenkins/home /var/lib/jenkins/backup
+ keepdir /var/log/jenkins /var/lib/jenkins/backup /var/lib/jenkins/home
insinto /opt/jenkins
newins "${DISTDIR}"/${P}.war ${PN/-bin/}.war
- newinitd "${FILESDIR}"/${PN}.init jenkins
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}.logrotate ${PN}
+
+ newinitd "${FILESDIR}"/${PN}.init2 jenkins
newconfd "${FILESDIR}"/${PN}.confd jenkins
- fowners jenkins:jenkins /var/run/jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
+ fowners jenkins:jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
}