-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update jenkins-slave.RedHat init.d script work bash < 4.0 #314
Conversation
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
@@ -37,7 +37,7 @@ slave_start() { | |||
|
|||
# --user in daemon doesn't prepare environment variables like HOME, USER, LOGNAME or USERNAME, | |||
# so we let su do so for us now | |||
$RUNUSER - $JENKINS_SLAVE_USER -c "$JAVA $JAVA_ARGS -jar $JENKINS_SLAVE_JAR $JENKINS_SLAVE_ARGS &>> $JENKINS_SLAVE_LOG &" | |||
$RUNUSER - $JENKINS_SLAVE_USER -c "$JAVA $JAVA_ARGS -jar $JENKINS_SLAVE_JAR $JENKINS_SLAVE_ARGS >> $JENKINS_SLAVE_LOG 2>> $JENKINS_SLAVE_LOG &" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does >> $JENKINS_SLAVE_LOG 2>&1
work with your version of bash? That would be a bit DRYer.
I like your way better - It does indeed work in bash < 4.0 - Pull request modified |
@jhoblitt Is this diff to your liking? I would really like to get this change in so we may use this puppet class stock in our infrastructure where I work, and this is the only change needed to get Jenkins "swarm" slaves functioning on CentOS-5.x in our infrastructure. |
The PR passed the acceptance tests on the |
Update jenkins-slave.RedHat init.d script work bash < 4.0
Thanks @jhoblitt |
@andrew-sumner No, thank you both for work on fixing this and your patience in getting it merged. |
(First pull request, please be gentle)
Related to issue #225
This change makes the init script work on CentOS-5.x - or really any host using bash less than version 4.0. This is the original error I was receiving:
This change is more portable than the original command line. So even if this project doesn't want to support CentOS-5.x, this change still guards against shell "gotchas" like this.