diff --git a/core/src/main/java/hudson/util/HudsonIsRestarting.java b/core/src/main/java/hudson/util/HudsonIsRestarting.java
index a0dccc545a71..580a9713a08d 100644
--- a/core/src/main/java/hudson/util/HudsonIsRestarting.java
+++ b/core/src/main/java/hudson/util/HudsonIsRestarting.java
@@ -41,8 +41,29 @@
* @author Kohsuke Kawaguchi
*/
public class HudsonIsRestarting {
+ private boolean safeRestart;
+
+ /**
+ * @since TODO
+ */
+ public HudsonIsRestarting(boolean safeRestart) {
+ this.safeRestart = safeRestart;
+ }
+
+ @Deprecated
+ public HudsonIsRestarting() {
+ this.safeRestart = false;
+ }
+
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
rsp.setStatus(SC_SERVICE_UNAVAILABLE);
req.getView(this, "index.jelly").forward(req, rsp);
}
+
+ /**
+ * @since TODO
+ */
+ public boolean isSafeRestart() {
+ return safeRestart;
+ }
}
diff --git a/core/src/main/java/jenkins/cli/SafeRestartCommand.java b/core/src/main/java/jenkins/cli/SafeRestartCommand.java
new file mode 100644
index 000000000000..9f83627ba844
--- /dev/null
+++ b/core/src/main/java/jenkins/cli/SafeRestartCommand.java
@@ -0,0 +1,59 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2023, Jan Meiswinkel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package jenkins.cli;
+
+import hudson.Extension;
+import hudson.cli.CLICommand;
+import hudson.cli.Messages;
+import java.util.logging.Logger;
+import jenkins.model.Jenkins;
+import org.kohsuke.accmod.Restricted;
+import org.kohsuke.accmod.restrictions.NoExternalUse;
+import org.kohsuke.args4j.Option;
+
+/**
+ * Safe Restart Jenkins - do not accept any new jobs and try to pause existing.
+ *
+ * @since TODO
+ */
+@Extension
+@Restricted(NoExternalUse.class)
+public class SafeRestartCommand extends CLICommand {
+ private static final Logger LOGGER = Logger.getLogger(SafeRestartCommand.class.getName());
+
+ @Option(name = "-message", usage = "Message for safe restart that will be visible to users")
+ public String message = null;
+
+ @Override
+ public String getShortDescription() {
+ return Messages.SafeRestartCommand_ShortDescription();
+ }
+
+ @Override
+ protected int run() throws Exception {
+ Jenkins.get().doSafeRestart(null, message);
+ return 0;
+ }
+}
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index 2696b4160b35..17914efda4f2 100644
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -482,6 +482,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
@CheckForNull
private transient volatile QuietDownInfo quietDownInfo;
+
private transient volatile boolean terminating;
@GuardedBy("Jenkins.class")
private transient boolean cleanUpStarted;
@@ -2943,6 +2944,20 @@ public boolean isQuietingDown() {
return quietDownInfo != null;
}
+ /**
+ * Returns if the quietingDown is a safe restart.
+ * @since TODO
+ */
+ @Restricted(NoExternalUse.class)
+ @NonNull
+ public boolean isPreparingSafeRestart() {
+ QuietDownInfo quietDownInfo = this.quietDownInfo;
+ if (quietDownInfo != null) {
+ return quietDownInfo.isSafeRestart();
+ }
+ return false;
+ }
+
/**
* Returns quiet down reason if it was indicated.
* @return
@@ -2953,7 +2968,7 @@ public boolean isQuietingDown() {
@CheckForNull
public String getQuietDownReason() {
final QuietDownInfo info = quietDownInfo;
- return info != null ? info.reason : null;
+ return info != null ? info.message : null;
}
/**
@@ -4093,7 +4108,7 @@ public synchronized HttpRedirect doQuietDown() {
*
* @param block Block until the system really quiets down and no builds are running
* @param timeout If non-zero, only block up to the specified number of milliseconds
- * @deprecated since 2.267; use {@link #doQuietDown(boolean, int, String)} instead.
+ * @deprecated since 2.267; use {@link #doQuietDown(boolean, int, String, boolean)} instead.
*/
@Deprecated
public synchronized HttpRedirect doQuietDown(boolean block, int timeout) {
@@ -4109,16 +4124,34 @@ public synchronized HttpRedirect doQuietDown(boolean block, int timeout) {
*
* @param block Block until the system really quiets down and no builds are running
* @param timeout If non-zero, only block up to the specified number of milliseconds
- * @param reason Quiet reason that will be visible to user
- * @since 2.267
+ * @param message Quiet reason that will be visible to user
+ * @deprecated use {@link #doQuietDown(boolean, int, String, boolean)} instead.
+ */
+ @Deprecated(since = "TODO")
+ public HttpRedirect doQuietDown(boolean block,
+ int timeout,
+ @CheckForNull String message) throws InterruptedException, IOException {
+
+ return doQuietDown(block, timeout, message, false);
+ }
+
+ /**
+ * Quiet down Jenkins - preparation for a restart
+ *
+ * @param block Block until the system really quiets down and no builds are running
+ * @param timeout If non-zero, only block up to the specified number of milliseconds
+ * @param message Quiet reason that will be visible to user
+ * @param safeRestart If the quietDown is for a safeRestart
+ * @since TODO
*/
@RequirePOST
public HttpRedirect doQuietDown(@QueryParameter boolean block,
@QueryParameter int timeout,
- @QueryParameter @CheckForNull String reason) throws InterruptedException, IOException {
+ @QueryParameter @CheckForNull String message,
+ @QueryParameter boolean safeRestart) throws InterruptedException, IOException {
synchronized (this) {
checkPermission(MANAGE);
- quietDownInfo = new QuietDownInfo(reason);
+ quietDownInfo = new QuietDownInfo(message, safeRestart);
}
if (block) {
long waitUntil = timeout;
@@ -4513,20 +4546,35 @@ public void doRestart(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
}
/**
- * Queues up a restart of Jenkins for when there are no builds running, if we can.
+ * Queues up a safe restart of Jenkins.
+ * Builds that cannot continue while the controller is not running have to finish or pause before it can proceed.
+ * No new builds will be started. No new jobs are accepted.
*
- * This first replaces "app" to {@link HudsonIsRestarting}
+ * @deprecated use {@link #doSafeRestart(StaplerRequest, String)} instead.
*
- * @since 1.332
*/
- @CLIMethod(name = "safe-restart")
+ @Deprecated(since = "TODO")
public HttpResponse doSafeRestart(StaplerRequest req) throws IOException, ServletException, RestartNotSupportedException {
+ return doSafeRestart(req, null);
+ }
+
+ /**
+ * Queues up a safe restart of Jenkins. Jobs have to finish or pause before it can proceed. No new jobs are accepted.
+ *
+ * @since TODO
+ */
+ public HttpResponse doSafeRestart(StaplerRequest req, @QueryParameter("message") String message) throws IOException, ServletException, RestartNotSupportedException {
checkPermission(MANAGE);
- if (req != null && req.getMethod().equals("GET"))
+ if (req != null && req.getMethod().equals("GET")) {
return HttpResponses.forwardToView(this, "_safeRestart.jelly");
+ }
+
+ if (req != null && req.getParameter("cancel") != null) {
+ return doCancelQuietDown();
+ }
if (req == null || req.getMethod().equals("POST")) {
- safeRestart();
+ safeRestart(message);
}
return HttpResponses.redirectToDot();
@@ -4572,11 +4620,22 @@ public void run() {
/**
* Queues up a restart to be performed once there are no builds currently running.
* @since 1.332
+ * @deprecated use {@link #safeRestart(String)} instead.
*/
+ @Deprecated(since = "TODO")
public void safeRestart() throws RestartNotSupportedException {
+ safeRestart(null);
+ }
+
+ /**
+ * Queues up a restart to be performed once there are no builds currently running.
+ * @param message the message to show to users in the shutdown banner.
+ * @since TODO
+ */
+ public void safeRestart(String message) throws RestartNotSupportedException {
final Lifecycle lifecycle = restartableLifecycle();
// Quiet down so that we won't launch new builds.
- quietDownInfo = new QuietDownInfo();
+ quietDownInfo = new QuietDownInfo(message, true);
new Thread("safe-restart thread") {
final String exitUser = getAuthentication2().getName();
@@ -4585,11 +4644,10 @@ public void run() {
try (ACLContext ctx = ACL.as2(ACL.SYSTEM2)) {
// Wait 'til we have no active executors.
- doQuietDown(true, 0, null);
-
+ doQuietDown(true, 0, message, true);
// Make sure isQuietingDown is still true.
if (isQuietingDown()) {
- servletContext.setAttribute("app", new HudsonIsRestarting());
+ servletContext.setAttribute("app", new HudsonIsRestarting(true));
// give some time for the browser to load the "reloading" page
lifecycle.onStatusUpdate("Restart in 10 seconds");
Thread.sleep(TimeUnit.SECONDS.toMillis(10));
@@ -5761,16 +5819,31 @@ private static void _setJenkinsJVM(boolean jenkinsJVM) {
}
private static final class QuietDownInfo {
-
@CheckForNull
- final String reason;
+ final String message;
+
+ private boolean safeRestart;
QuietDownInfo() {
- this(null);
+ this(null, false);
+ }
+
+ QuietDownInfo(final String message) {
+ this(message, false);
+ }
+
+ QuietDownInfo(final String message, final boolean safeRestart) {
+ this.message = message;
+ this.safeRestart = safeRestart;
+ }
+
+
+ boolean isSafeRestart() {
+ return safeRestart;
}
- QuietDownInfo(final String reason) {
- this.reason = reason;
+ void setSafeRestart(boolean safeRestart) {
+ this.safeRestart = safeRestart;
}
}
}
diff --git a/core/src/main/resources/hudson/cli/Messages.properties b/core/src/main/resources/hudson/cli/Messages.properties
index bc6068df321a..15d27a2433b2 100644
--- a/core/src/main/resources/hudson/cli/Messages.properties
+++ b/core/src/main/resources/hudson/cli/Messages.properties
@@ -84,6 +84,7 @@ ReloadConfigurationCommand.ShortDescription=Discard all the loaded data in memor
ConnectNodeCommand.ShortDescription=Reconnect to a node(s)
DisconnectNodeCommand.ShortDescription=Disconnects from a node.
QuietDownCommand.ShortDescription=Quiet down Jenkins, in preparation for a restart. Don’t start any builds.
+SafeRestartCommand.ShortDescription=Safe Restart Jenkins. Don’t start any builds.
CancelQuietDownCommand.ShortDescription=Cancel the effect of the "quiet-down" command.
OfflineNodeCommand.ShortDescription=Stop using a node for performing builds temporarily, until the next "online-node" command.
WaitNodeOnlineCommand.ShortDescription=Wait for a node to become online.
diff --git a/core/src/main/resources/hudson/cli/Messages_de.properties b/core/src/main/resources/hudson/cli/Messages_de.properties
index 1a390a6d1ecb..eef93169fc1a 100644
--- a/core/src/main/resources/hudson/cli/Messages_de.properties
+++ b/core/src/main/resources/hudson/cli/Messages_de.properties
@@ -39,6 +39,7 @@ ListPluginsCommand.ShortDescription=Gibt eine Liste installierter Plugins aus.
OfflineNodeCommand.ShortDescription=Knoten wird bis zum nächsten "online-node"-Kommando für keine neuen Builds verwendet.
OnlineNodeCommand.ShortDescription=Knoten wird wieder für neue Builds verwendet. Hebt ein vorausgegangenes "offline-node"-Kommando auf.
QuietDownCommand.ShortDescription=Keine neuen Builds mehr starten, z.B. zur Vorbereitung eines Neustarts.
+SafeRestartCommand.ShortDescription=Sicheren Neustart einleiten. Keine neuen Builds mehr starten und versuchen, laufende zu pausieren.
ReloadConfigurationCommand.ShortDescription=Alle Daten im Speicher verwerfen und Konfiguration neu von Festplatte laden. Dies ist nützlich, wenn Sie Änderungen direkt im Dateisystem vorgenommen haben.
ReloadJobCommand.ShortDescription=Lädt ein Element neu.
RemoveJobFromViewCommand.ShortDescription=Entfernt Elemente aus einer Ansicht
diff --git a/core/src/main/resources/hudson/util/HudsonIsRestarting/index.jelly b/core/src/main/resources/hudson/util/HudsonIsRestarting/index.jelly
index 63c501a8426e..c51e37e67687 100644
--- a/core/src/main/resources/hudson/util/HudsonIsRestarting/index.jelly
+++ b/core/src/main/resources/hudson/util/HudsonIsRestarting/index.jelly
@@ -56,6 +56,17 @@ THE SOFTWARE.
${%Your browser will reload automatically when Jenkins is ready.}
+
+
+
+ ${%Safe Restart}
+
+
+ ${%Builds on agents can usually continue.}
+
+
+
+
diff --git a/core/src/main/resources/hudson/util/HudsonIsRestarting/index_de.properties b/core/src/main/resources/hudson/util/HudsonIsRestarting/index_de.properties
index 16b1bacda1f8..1750883d183d 100644
--- a/core/src/main/resources/hudson/util/HudsonIsRestarting/index_de.properties
+++ b/core/src/main/resources/hudson/util/HudsonIsRestarting/index_de.properties
@@ -1,2 +1,6 @@
-Please\ wait\ while\ Jenkins\ is\ restarting=Jenkins wird neu gestartet. Bitte warten
+Please\ wait\ while\ Jenkins\ is\ restarting=Jenkins wird neu gestartet. Bitte warten.
Your\ browser\ will\ reload\ automatically\ when\ Jenkins\ is\ ready.=Der Webbrowser wird diese Seite automatisch neu laden, sobald Jenkins hochgefahren ist.
+Safe\ Restart=Sicherer Neustart
+Builds\ on\ agents\ can\ usually\ continue.=Builds auf Agenten laufen in der Regel weiter.
+Restart=Neustarten
+Cancel=Abbrechen
\ No newline at end of file
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.jelly b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.jelly
index 787042414bc9..fb33dc32e89c 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.jelly
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.jelly
@@ -25,19 +25,30 @@ THE SOFTWARE.
-
+
-
+
+
-
+ ${%restartWarning}
+
+
- ${%Jenkins cannot restart itself as currently configured.}
+ ${%cannotRestart}
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.properties
index 631b3b5a2486..e6093c94e436 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart.properties
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-confirmRestart=\
- Are you sure you want to restart Jenkins? \
- Jenkins will restart once all running jobs are finished. \
+cannotRestart=Jenkins cannot restart itself as currently configured.
+description=This will be displayed on most Jenkins pages, you can use it to let users know what is happening. A default message will be added if you don't supply one.
+restartWarning=Jenkins will try to pause jobs and restart once all running jobs are either finished or paused. \
(Pipeline builds may prevent Jenkins from restarting for a short period of time in some cases, but if so, they will be paused at the next available opportunity and then resumed after Jenkins restarts.)
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_bg.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_bg.properties
index 6538046d0207..666e96c8a03f 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_bg.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_bg.properties
@@ -20,7 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=\
+cannotRestart=\
С текущите си настройки Jenkins не може да се рестартира.
-Yes=\
- Да
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_da.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_da.properties
deleted file mode 100644
index 1d3dcce7bd16..000000000000
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_da.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# The MIT License
-#
-# Copyright (c) 2004-2010, Sun Microsystems, Inc. Kohsuke Kawaguchi. Knud Poulsen.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-Yes=Ja
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_de.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_de.properties
index 0339ce968f11..bf94beb0d5e6 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_de.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_de.properties
@@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Yes=Ja
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Jenkins kann sich wie konfiguriert nicht selbst neu starten.
+cannotRestart=Jenkins kann sich wie konfiguriert nicht selbst neu starten.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_es.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_es.properties
deleted file mode 100644
index add83dfcb8f4..000000000000
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_es.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# The MIT License
-#
-# Copyright (c) 2004-2010, Sun Microsystems, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-Yes=Sí
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_fr.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_fr.properties
deleted file mode 100644
index 885c70af51db..000000000000
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_fr.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# The MIT License
-#
-# Copyright (c) 2004-2010, Sun Microsystems, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-Yes=Oui
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_it.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_it.properties
index 8eed9a0ce6e1..7236625bf82e 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_it.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_it.properties
@@ -21,6 +21,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Jenkins non può \
+cannotRestart=Jenkins non può \
riavviarsi autononomamente così come configurato attualmente.
-Yes=Sì
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ja.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ja.properties
deleted file mode 100644
index b4b315371f24..000000000000
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ja.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# The MIT License
-#
-# Copyright (c) 2004-2010, Sun Microsystems, Inc., Seiji Sogabe
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-Yes=はい
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lt.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lt.properties
index 5e2bb304fab3..86b8fa4f7937 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lt.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lt.properties
@@ -1,2 +1 @@
-Yes=Taip
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Toks, kaip dabar sukonfigūruotas, Jenkinas negali pats savęs paleisti iš naujo.
+cannotRestart=Toks, kaip dabar sukonfigūruotas, Jenkinas negali pats savęs paleisti iš naujo.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lv.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lv.properties
deleted file mode 100644
index 6648ea4e403b..000000000000
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_lv.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# The MIT License
-#
-# Copyright (c) 2004-2010, Sun Microsystems, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-Yes=Jā
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_pt_BR.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_pt_BR.properties
index 29dade803852..98a7deea70cb 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_pt_BR.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_pt_BR.properties
@@ -20,10 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Yes=Sim
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=O Jenkins não pode se reiniciar da forma como está \
+cannotRestart=O Jenkins não pode se reiniciar da forma como está \
atualmente configurado.
-confirmRestart=Você tem certeza de que quer reiniciar o Jenkins? Ele irá reiniciar quando todos os trabalhos estiverem \
- terminado. Processos de construção podem impedir que o Jenkins reinicie por um período custo de tempo em alguns \
- casos, mas se isso ocorrer, eles irão ser colocados em pausa assim que possível e então continuarem quando o Jenkins \
- reiniciar.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ru.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ru.properties
index c35bcb3f7b8d..1e5b14446762 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ru.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_ru.properties
@@ -1,2 +1 @@
-Yes=Да
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=В текущей конфигурации Jenkins не может перезапуститься сам.
+cannotRestart=В текущей конфигурации Jenkins не может перезапуститься сам.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_sr.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_sr.properties
index 57eb4de45f1a..9ef52651a2d3 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_sr.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_sr.properties
@@ -1,4 +1,3 @@
# This file is under the MIT License by authors
-Yes=Да
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Неможе се поново покренути Jenkins за овим подешавањима.
+cannotRestart=Неможе се поново покренути Jenkins за овим подешавањима.
diff --git a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_zh_TW.properties b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_zh_TW.properties
index 9f5f465bce40..b91deccbc994 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_zh_TW.properties
+++ b/core/src/main/resources/jenkins/model/Jenkins/_safeRestart_zh_TW.properties
@@ -21,5 +21,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-Yes=是
-Jenkins\ cannot\ restart\ itself\ as\ currently\ configured.=Jenkins 無法在目前的設定值下自行重新啟動。
+cannotRestart=Jenkins 無法在目前的設定值下自行重新啟動。
diff --git a/core/src/main/resources/lib/layout/main-panel.jelly b/core/src/main/resources/lib/layout/main-panel.jelly
index eb374d67b044..3c2206e1a47a 100644
--- a/core/src/main/resources/lib/layout/main-panel.jelly
+++ b/core/src/main/resources/lib/layout/main-panel.jelly
@@ -30,11 +30,32 @@ THE SOFTWARE.
- ${%Jenkins is going to shut down}
-
-
${%Shut down reason}: ${app.getQuietDownReason()}
-
-
+
+
+
+
+
+ ${app.getQuietDownReason()}
+
+
+ ${%saferestart}
+
+
+
+
+
+
+
+
+ ${app.getQuietDownReason()}
+
+
+ ${%shutdown}
+
+
+
+
+
diff --git a/core/src/main/resources/lib/layout/main-panel.properties b/core/src/main/resources/lib/layout/main-panel.properties
new file mode 100644
index 000000000000..55b368387a92
--- /dev/null
+++ b/core/src/main/resources/lib/layout/main-panel.properties
@@ -0,0 +1,2 @@
+shutdown=The Jenkins Controller is preparing for shutdown. No new builds can be started.
+saferestart=The Jenkins Controller is restarting safely. Running builds will finish or continue afterwards, depending on the job type. No new builds can be started.
diff --git a/core/src/main/resources/lib/layout/main-panel_de.properties b/core/src/main/resources/lib/layout/main-panel_de.properties
index 370bd836a5c8..8bbc3313c64c 100644
--- a/core/src/main/resources/lib/layout/main-panel_de.properties
+++ b/core/src/main/resources/lib/layout/main-panel_de.properties
@@ -1 +1,2 @@
-Jenkins\ is\ going\ to\ shut\ down=Jenkins wird heruntergefahren
+shutdown=Jenkins wird heruntergefahren. Es werden keine weiteren Jobs angenommen und laufende Jobs werden pausiert.
+saferestart=Jenkins wird sicher neu gestartet. Laufende Jobs werden entweder beendet oder laufen nach dem Restart weiter, abhängig vom Jobtyp. Es können keine weiteren Jobs gestartet werden.
diff --git a/war/src/main/scss/base/style.scss b/war/src/main/scss/base/style.scss
index 8ed036933f46..aa8e3a5ade5b 100644
--- a/war/src/main/scss/base/style.scss
+++ b/war/src/main/scss/base/style.scss
@@ -77,6 +77,17 @@ td.no-wrap {
border-collapse: collapse;
}
+#safe-restart-msg {
+ font-weight: bold;
+ color: white;
+ background-color: var(--warning);
+ text-align: center;
+ margin-bottom: var(--section-padding);
+ padding: 0.5em;
+ -moz-border-radius: 0.5em;
+ border-radius: var(--form-input-border-radius);
+}
+
#shutdown-msg {
font-weight: bold;
color: white;
diff --git a/war/src/main/scss/simple-page.scss b/war/src/main/scss/simple-page.scss
index 2f65c736883b..c80f6e1303d7 100644
--- a/war/src/main/scss/simple-page.scss
+++ b/war/src/main/scss/simple-page.scss
@@ -35,6 +35,21 @@
text-align: center;
}
+.simple-page .safe-restarting {
+ text-align: center;
+ border-color: var(--alert-success-border-color);
+ background-color: var(--alert-success-bg-color);
+ border-width: 2px;
+ border-radius: 2px;
+ border-style: solid;
+ margin: 5% auto auto;
+ padding: 5px;
+}
+
+.simple-page .safe-restarting > p {
+ margin: 0;
+}
+
.simple-page--description {
margin-top: 0;
margin-bottom: var(--section-padding);