Description of problem: Set Post-Commit Hooks by script with args from web console and start build, build log contains some irrelevant lines. Version-Release number of selected component (if applicable): v1.5.0-alpha.1+68d4d0a-322-dirty How reproducible: Always Steps to Reproduce: 1. # oc new-project xiaocwan-t # oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json 2. # Edit bc on web console click "Show advanced options" and find "Post-Commit Hooks" set Shell Script with Arguments Script -> echo "this is a script" 1 arguments: hello -> click Add 3. Save and start build#2 and check log in web terminal again Actual results: Build#2 log contains below output ---> Cleaning up unused ruby gems ... Running post commit hook ... sh: cannot set terminal process group (-1): Inappropriate ioctl for device sh: no job control in this shell this is a script Pushing image x.x.x.x:5000/xiaocwan-t/origin-ruby-sample:latest ... ... Then the build is completed. Expected results: Seems these 2 lines has no reason to display: sh: cannot set terminal process group (-1): Inappropriate ioctl for device sh: no job control in this shell Additional info: test command with args will not reproduced, output is below """ Running post commit hook ... hello """ BC config for Post-Commit Hooks: Command: echo Args: hello
According to a comment in the code (located here: https://github.com/openshift/origin/blob/master/pkg/build/builder/common.go#L124) "// The `-i` flag is needed to support CentOS and RHEL images // that use Software Collections (SCL), in order to have the // appropriate collections enabled in the shell. E.g., in the // Ruby image, this is necessary to make `ruby`, `bundle` and // other binaries available in the PATH." So, the first example that you showed that shows the extra lines of output is the equivalent of: docker run centos /bin/sh -ic echo "this is a test" /bin/sh hello And the second example that does NOT show the extra lines is the equivalent of: docker run centos echo hello If you run those commands on your workstation you will get the same lines output. Which seems to make this a docker issue that is possibly fixed in docker 1.2 from what I have read. Closing as not a bug.
Moving to ON_QA so test cases (if applicable) can be updated.
This is caused by an old existed docker issue: https://github.com/docker/docker/issues/18 'docker run centos /bin/sh -ic echo "this is a test" /bin/sh hello' will get the message 'docker run centos echo hello' will not get the message Case will be updated to use other image or ignore it for this scenario. So close it as not a bug.