• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • systemd

      If hudson.lifecycle.ExitLifecycle is selected, jenkins will exit when
      restart is requested. Exit code is taken out of
      jenkins.model.Jenkins.exitCodeOnRestart, default is 5.

      This is usable when there is an external watchdog such as SystemD.

      SystemD service example:

      ExecStart=@/usr/bin/java jenkins $JAVA_OPTIONS -DJENKINS_HOME=${JENKINS_HOME} -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle -Djenkins.model.Jenkins.exitCodeOnRestart=55 -jar $JENKINS_WAR --debug=${JENKINS_DEBUG_LEVEL} --httpPort=${JENKINS_PORT} --httpListenAddress=${JENKINS_LISTEN_ADDRESS} $JENKINS_ARGS
      

          [JENKINS-47043] Support custom command for Jenkins restart

          Alon Bar-Lev created issue -
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-34254 [ JENKINS-34254 ]
          Alon Bar-Lev made changes -
          Remote Link New: This issue links to "Support restartCommand configuration (Web Link)" [ 17755 ]
          Alon Bar-Lev made changes -
          Remote Link New: This issue links to "Support exitOnRestart configuration (Web Link)" [ 17756 ]
          Alon Bar-Lev made changes -
          Labels New: core init-script patch
          Alon Bar-Lev made changes -
          Description Original: Currently Jenkins tries to restart by fork/exec the argv[0].

          In systemd or any other watchdog environment this is not useful as process can exit normally and restarted by systemd.

          argv[0] is used only for eye catcher.

          For example:
          {code:java}
          ExecStart=@/usr/lib/jvm/jre-1.8.0/bin/java jenkins $JAVA_OPTIONS -DJENKINS_HOME=${JENKINS_HOME} -jar $JENKINS_WAR --debug=${JENKINS_DEBUG_LEVEL} --httpPort=${JENKINS_PORT} --httpListenAddress=${JENKINS_LISTEN_ADDRESS} $JENKINS_ARGS
          {code}
          Please consider adding an option to exit normally when restarted instead of executing a process.

          This should have some priority since the /exit URL command is not working.

          Thanks!

           
          New: If hudson.lifecycle.ExitLifecycle is selected, jenkins will exit when
          restart is requested. Exit code is taken out of
          jenkins.model.Jenkins.exitCodeOnRestart, default is 5.

          This is usable when there is an external watchdog such as SystemD.

          SystemD service example:

          {code}
          ExecStart=@/usr/bin/java jenkins $JAVA_OPTIONS -DJENKINS_HOME=${JENKINS_HOME} -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle -Djenkins.model.Jenkins.exitCodeOnRestart=55 -jar $JENKINS_WAR --debug=${JENKINS_DEBUG_LEVEL} --httpPort=${JENKINS_PORT} --httpListenAddress=${JENKINS_LISTEN_ADDRESS} $JENKINS_ARGS
          {code}
          Oleg Nenashev made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Mark Waite made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            Unassigned Unassigned
            alonbl Alon Bar-Lev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: