Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23911

Shell command doesn't run in background

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ssh-plugin
    • None
    • Centos 5.10

      At some point in the recent releases, it seems Jenkins can no longer runs background shell commands correctly. That is, it waits for the job to finish.

      I have updated to the latest version of Jenkins and the SSH plugin. I have reproduced the problem with the following job:

      echo 'Jenkins start:'
      date
      sh /tmp/test.sh &
      echo 'Jenkins end:'
      date

      This produces the output:

      + echo 'Jenkins start:'
      Jenkins start:
      + date
      Mon Jul 21 14:20:40 EDT 2014
      + sh /tmp/test.sh
      + echo 'Jenkins end:'
      Jenkins end:
      + date
      Mon Jul 21 14:20:40 EDT 2014
      Script end:
      Mon Jul 21 14:20:50 EDT 2014

      The script contains:

      sleep 10
      echo 'Script end:'
      date

      Considering this does not work over SSH shell script or a local shell script, my guess would be in the last few releases something changes with the escaping of an ampersand.

            Unassigned Unassigned
            viastudio VIA Studio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: