Details
-
Type:
Improvement
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: core
-
Labels:
-
Environment:systemd
-
Similar Issues:
Description
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
Attachments
Issue Links
- is related to
-
JENKINS-34254 Shutdown of jenkins via the /exit URL doesn't work in 2.0 b/c of 403
-
- Resolved
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue is related to |
Remote Link | This issue links to "Support restartCommand configuration (Web Link)" [ 17755 ] |
Remote Link | This issue links to "Support exitOnRestart configuration (Web Link)" [ 17756 ] |
Labels | core init-script patch |
Description |
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! |
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} |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
This makes no sense. I mean, if you set up your system to restart automatically when exiting, sure, but think of how this would need to be documented.
If this is about
JENKINS-34254, it'd be much better to just fix that rather than hack around it.Meanwhile, you could use the CLI command shutdown to get the same result as /exit if it worked.