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

Jenkins on Linux can not restart after plugin update

      Jenkins can not restart after plugin update if jenkins' java is started with 'java' and without full path.

      It doesn't rexec itself with the following logs:
      Warnung: Failed to restart Jenkins
      java.io.IOException: Failed to exec 'java' Datei oder Verzeichnis nicht gefunden
      at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:84)
      at jenkins.model.Jenkins$24.run(Jenkins.java:3337)

      It seems to be caused by this recent change:
      https://github.com/jenkinsci/jenkins/commit/547d4ed8d35de6be4b2788e4816019bb8cc94902#diff-1df54b5ad5f99455e21579688db5be50

      From a quick look I guess this could be fixed by using execvp instead of execv as below:

      • LIBC.execv(exe, new StringArray(args.toArray(new String[args.size()])));
        + LIBC.execvp(exe, new StringArray(args.toArray(new String[args.size()])));

      I understand that for those calling java as /usr/bin/java the execv approach should work, but without the full path it should still work IMHO.

      Thanks,
      Simon

          [JENKINS-22818] Jenkins on Linux can not restart after plugin update

          Simon Matter created issue -
          Simon Matter made changes -
          Description Original: Jenkins can not restart after plugin update if jenkins' java is started with 'java' and without full path.

          It doesn't rexec itself with the following logs:
          Warnung: Failed to restart Jenkins
          java.io.IOException: Failed to exec 'java' Datei oder Verzeichnis nicht gefunden
                  at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:84)
                  at jenkins.model.Jenkins$24.run(Jenkins.java:3337)

          It seems to be caused by this recent change:
          https://github.com/jenkinsci/jenkins/commit/547d4ed8d35de6be4b2788e4816019bb8cc94902#diff-1df54b5ad5f99455e21579688db5be50

          From a quick look I guess this could be fixed by using execvp instead of execv as below:

          - LIBC.execv(exe, new StringArray(args.toArray(new String[args.size()])));
          + LIBC.execvp(exe, new StringArray(args.toArray(new String[args.size()])));

          I understand that for those calling java as /usr/bin/java the execv approach should work, but without the full path it should still work IMHO.

          Thanks,
          Simon
          New: Jenkins can not restart after plugin update if jenkins' java is started with 'java' and without full path.

          It doesn't rexec itself with the following logs:
          Warnung: Failed to restart Jenkins
          java.io.IOException: Failed to exec 'java' Datei oder Verzeichnis nicht gefunden
                  at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:84)
                  at jenkins.model.Jenkins$24.run(Jenkins.java:3337)

          It seems to be caused by this recent change:
          https://github.com/jenkinsci/jenkins/commit/547d4ed8d35de6be4b2788e4816019bb8cc94902#diff-1df54b5ad5f99455e21579688db5be50

          From a quick look I guess this could be fixed by using execvp instead of execv as below:

           - LIBC.execv(exe, new StringArray(args.toArray(new String[args.size()])));
           + LIBC.execvp(exe, new StringArray(args.toArray(new String[args.size()])));

          I understand that for those calling java as /usr/bin/java the execv approach should work, but without the full path it should still work IMHO.

          Thanks,
          Simon
          Simon Matter made changes -
          Description Original: Jenkins can not restart after plugin update if jenkins' java is started with 'java' and without full path.

          It doesn't rexec itself with the following logs:
          Warnung: Failed to restart Jenkins
          java.io.IOException: Failed to exec 'java' Datei oder Verzeichnis nicht gefunden
                  at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:84)
                  at jenkins.model.Jenkins$24.run(Jenkins.java:3337)

          It seems to be caused by this recent change:
          https://github.com/jenkinsci/jenkins/commit/547d4ed8d35de6be4b2788e4816019bb8cc94902#diff-1df54b5ad5f99455e21579688db5be50

          From a quick look I guess this could be fixed by using execvp instead of execv as below:

           - LIBC.execv(exe, new StringArray(args.toArray(new String[args.size()])));
           + LIBC.execvp(exe, new StringArray(args.toArray(new String[args.size()])));

          I understand that for those calling java as /usr/bin/java the execv approach should work, but without the full path it should still work IMHO.

          Thanks,
          Simon
          New: Jenkins can not restart after plugin update if jenkins' java is started with 'java' and without full path.

          It doesn't rexec itself with the following logs:
          Warnung: Failed to restart Jenkins
          java.io.IOException: Failed to exec 'java' Datei oder Verzeichnis nicht gefunden
                  at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:84)
                  at jenkins.model.Jenkins$24.run(Jenkins.java:3337)

          It seems to be caused by this recent change:
          https://github.com/jenkinsci/jenkins/commit/547d4ed8d35de6be4b2788e4816019bb8cc94902#diff-1df54b5ad5f99455e21579688db5be50

          From a quick look I guess this could be fixed by using execvp instead of execv as below:

          - LIBC.execv(exe, new StringArray(args.toArray(new String[args.size()])));
          + LIBC.execvp(exe, new StringArray(args.toArray(new String[args.size()])));

          I understand that for those calling java as /usr/bin/java the execv approach should work, but without the full path it should still work IMHO.

          Thanks,
          Simon
          Jesse Glick made changes -
          Labels New: regression
          Simon Matter made changes -
          Attachment New: UnixLifecycle.patch [ 25778 ]
          Daniel Beck made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Labels Original: regression New: linux regression restart
          Priority Original: Major [ 3 ] New: Critical [ 2 ]
          vjuranek made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Daniel Beck made changes -
          Labels Original: linux regression restart New: linux lts-candidate regression restart
          Oliver Gondža made changes -
          Labels Original: linux lts-candidate regression restart New: 1.565.1-fixed linux regression restart
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 154938 ] New: JNJira + In-Review [ 195088 ]

            Unassigned Unassigned
            simix Simon Matter
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: