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

Shell step fails on Mac: nohup: can't detach from console: No such file or directory

    XMLWordPrintable

Details

    Description

      Simple hello world from workflow-plugin

      node {
       sh 'echo hello world'
      }
      

      fails

      Running: Allocate node : Start
      Running on master in /Users/Shared/Jenkins/Home/jobs/workflow/workspace
      Running: Allocate node : Body : Start
      Running: Shell Script
      [workspace] Running shell script
      nohup: can't detach from console: No such file or directory
      Aborted by asdf
      Aborted by asdf
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      Finished: ABORTED
      

      Attachments

        Issue Links

          Activity

            danielbeck Daniel Beck added a comment -

            If Apple uses modified utils, their sources are on opensource.apple.com. For nohup, it's here (newest version):
            http://www.opensource.apple.com/source/shell_cmds/shell_cmds-179/nohup/nohup.c

            It's an error in _vprocmgr_detach_from_console which indicates the mode of installation and running Jenkins may indeed be relevant, as I know it in the context of disconnecting a process from a user session (see e.g. explanation https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard).

            When installing Jenkins via installer on a virtual machine with OS X 10.7, and installing Workflow Aggregator with dependencies, the job just stops after

            [workspace}Running shell script

            10.7 is ancient, but it appears there's something wrong with using nohup this way. In fact, if I run a shell script with e.g. nohup find / -L -type l, I get:

            Started by user anonymous
            Building in workspace /Users/Shared/Jenkins/Home/jobs/nohup/workspace
            [workspace] $ /bin/sh -xe /var/folders/rj/xt96v6dd5ls7v94142grnvn400007b/T/hudson3605439247319045393.sh
            + nohup find / -L -type l
            nohup: can't detach from console: Inappropriate ioctl for device
            Build step 'Execute shell' marked build as failure
            Finished: FAILURE
            
            danielbeck Daniel Beck added a comment - If Apple uses modified utils, their sources are on opensource.apple.com. For nohup, it's here (newest version): http://www.opensource.apple.com/source/shell_cmds/shell_cmds-179/nohup/nohup.c It's an error in _vprocmgr_detach_from_console which indicates the mode of installation and running Jenkins may indeed be relevant, as I know it in the context of disconnecting a process from a user session (see e.g. explanation https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard ). When installing Jenkins via installer on a virtual machine with OS X 10.7, and installing Workflow Aggregator with dependencies, the job just stops after [workspace}Running shell script 10.7 is ancient, but it appears there's something wrong with using nohup this way. In fact, if I run a shell script with e.g. nohup find / -L -type l , I get: Started by user anonymous Building in workspace /Users/Shared/Jenkins/Home/jobs/nohup/workspace [workspace] $ /bin/sh -xe /var/folders/rj/xt96v6dd5ls7v94142grnvn400007b/T/hudson3605439247319045393.sh + nohup find / -L -type l nohup: can't detach from console: Inappropriate ioctl for device Build step 'Execute shell' marked build as failure Finished: FAILURE
            jglick Jesse Glick added a comment -

            Hmm. Well, I am pushing a workaround. Someone with a Mac able to reproduce this, please test this build. Not just that you can run shell scripts on a Mac node from a workflow, but that they indeed survive a Jenkins restart or slave disconnect if it is e.g. sleep 100.

            jglick Jesse Glick added a comment - Hmm. Well, I am pushing a workaround. Someone with a Mac able to reproduce this, please test this build . Not just that you can run shell scripts on a Mac node from a workflow, but that they indeed survive a Jenkins restart or slave disconnect if it is e.g. sleep 100 .
            jglick Jesse Glick added a comment -

            JIRA link daemon is apparently dead again.

            jglick Jesse Glick added a comment - JIRA link daemon is apparently dead again.
            danielbeck Daniel Beck added a comment - - edited

            Confirmed:

            Started by user anonymous
            Running: Allocate node : Start
            Running on master in /Users/Shared/Jenkins/Home/jobs/wf/workspace
            Running: Allocate node : Body : Start
            Running: Shell Script
            [workspace] Running shell script
            + echo hello world
            hello world
            Running: Shell Script
            [workspace] Running shell script
            + sleep 100
            Resuming build
            Running: Allocate node : Body : End
            Running: Allocate node : End
            Running: End of Workflow
            Finished: SUCCESS
            danielbeck Daniel Beck added a comment - - edited Confirmed: Started by user anonymous Running: Allocate node : Start Running on master in /Users/Shared/Jenkins/Home/jobs/wf/workspace Running: Allocate node : Body : Start Running: Shell Script [workspace] Running shell script + echo hello world hello world Running: Shell Script [workspace] Running shell script + sleep 100 Resuming build Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Finished: SUCCESS

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java
            http://jenkins-ci.org/commit/durable-task-plugin/1957d3f51292b3e10e38ea9a400dcb8fa394d029
            Log:
            [FIXED JENKINS-25848] Skip nohup on Mac OS X, since it fails under some conditions.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java http://jenkins-ci.org/commit/durable-task-plugin/1957d3f51292b3e10e38ea9a400dcb8fa394d029 Log: [FIXED JENKINS-25848] Skip nohup on Mac OS X, since it fails under some conditions.

            People

              jglick Jesse Glick
              integer Kanstantsin Shautsou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: