提交 81d51294 编写于 作者: O Olav Reinert

[FIXED JENKINS-9011]: openSUSE: HOME path problem

Added a configuration option to control initialization of the
environment of the Jenkins server process.
上级 6ce99e92
......@@ -88,6 +88,10 @@ if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log"
fi
[ -z "$JENKINS_INIT_SHELL" -o -x "$JENKINS_INIT_SHELL" ] || { echo "JENKINS_INIT_SHELL does not refer to a shell: $JENKINS_INIT_SHELL";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
case "$1" in
start)
echo -n "Starting Jenkins "
......@@ -95,7 +99,11 @@ case "$1" in
CHECK=$?
if [ $CHECK -eq 7 ]; then
rm -f "$JENKINS_PID_FILE"
HOME=$JENKINS_HOME startproc -n $JENKINS_NICE -s -l /var/log/jenkins.rc -u "$JENKINS_USER" -p "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS
if [ -x "$JENKINS_INIT_SHELL" ]; then
startproc -n $JENKINS_NICE -s -e -l /var/log/jenkins.rc -p "$JENKINS_PID_FILE" -t 1 /bin/su -l -s "$JENKINS_INIT_SHELL" -c "$JAVA_CMD $PARAMS &" "$JENKINS_USER"
else
HOME=$JENKINS_HOME startproc -n $JENKINS_NICE -s -e -l /var/log/jenkins.rc -u "$JENKINS_USER" -p "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS
fi
JPROC=$( find /proc -maxdepth 2 -user $JENKINS_USER -name exe -lname "*/bin/java" )
if [ -n "$JPROC" ]; then
basename `dirname $JPROC` >"$JENKINS_PID_FILE"
......
......@@ -9,6 +9,19 @@
#
JENKINS_HOME="@@HOME@@"
## Type: string
## Default: "/bin/bash"
## ServiceRestart: jenkins
#
# Shell used to initialize the Jenkins server's environment.
# Setting this option to the path of a shell executable allows
# initialization of the Jenkins server environment using
# standard shell startup scripts.
# Disabling this option causes the Jenkins server to be run
# with a minimal environment.
#
JENKINS_INIT_SHELL="/bin/bash"
## Type: string
## Default: ""
## ServiceRestart: jenkins
......
......@@ -6,7 +6,7 @@
Name: jenkins
Version: %{ver}
Release: 1.1
Release: 1.2
Summary: Continous Build Server
Source: jenkins.war
Source1: jenkins.init.in
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册