Skip to end of metadata
Go to start of metadata

This plugin allows you to restart Jenkins safely.

Plugin Information

View Safe Restart on the plugin site for more information.

 This plugin allows you to restart Jenkins safely: it's waiting that all builds in progress finished before launching restart.

Side panel



Manage Jenkins page



Change Log

Version 0.3 (Apr. 22, 2013)

Version 0.2 (Sep. 8, 2011)

  • updated for Jenkins 1.421
  • lots of restructure, but brought back into the standards
  • fixing safe restart exception when safe restart is not a valid option

Version 0.1 (Oct. 18, 2010)

  • Initial release.

17 Comments

  1. I think the sidebar is too dangerous place for this kind of functionality?

    It's too easy to accidentally click 'Restart Safely' from the sidebar.

    1. It's a SAFE RESTART! If you really have a problem with a restart of Jenkins when no jobs are running (because of long initialization times, e.g.) then don't install this plugin. Additionally, the plugin requires a confirmation before the restart is commenced. It's pretty simple, I don't mean to be curt, but the concern you raise is a non-issue.

  2. Just upgraded from 1.421 to 1.423, not yet restarted. Try initiate Safe Restart, confirm it and get error:

    Status Code: 500
    
    Exception:
    Stacktrace:
    hudson.lifecycle.RestartNotSupportedException: Failed to obtain the command line arguments of the process
    	at hudson.lifecycle.UnixLifecycle.verifyRestartable(UnixLifecycle.java:96)
    	at jenkins.model.Jenkins.safeRestart(Jenkins.java:2977)
    	at jenkins.model.Jenkins.doSafeRestart(Jenkins.java:2936)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
    	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
    	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
    	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
    	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    	at org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
    	at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
    	at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
    	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:65)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
    	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:52)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
    	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
    	at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
    	at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
    	at com.sun.akuma.CLibrary.(CLibrary.java:54)
    	at com.sun.akuma.JavaVMArguments.resolvePID(JavaVMArguments.java:103)
    	at com.sun.akuma.JavaVMArguments.ofLinux(JavaVMArguments.java:91)
    	at com.sun.akuma.JavaVMArguments.of(JavaVMArguments.java:81)
    	at com.sun.akuma.JavaVMArguments.current(JavaVMArguments.java:69)
    	at hudson.lifecycle.UnixLifecycle.(UnixLifecycle.java:54)
    	at hudson.lifecycle.Lifecycle.get(Lifecycle.java:93)
    	at hudson.model.UpdateCenter.isDowngradable(UpdateCenter.java:342)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
    	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
    	at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
    	at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
    	at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
    	at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
    	at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
    	at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
    	at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
    	at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
    	at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:71)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:97)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63)
    	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
    	at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
    	at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63)
    	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
    	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
    	at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:92)
    	... 46 more
    
    
    1. I also hit this problem. Some times I have Jenkins deployed in a container that supports a Safe Restart, and sometimes not -- these are the dangers of deploying a fantastic tool like Jenkins in a wide variety of environments. I have fixed this with release 0.2, give it a shot and let me know what you think..

      http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/saferestart/0.2/

  3. I am getting the same stack trace on Jenkins 1.430 running SafeRestart plugin v0.2.

    hudson.lifecycle.RestartNotSupportedException: Failed to obtain the command line arguments of the process
    	at hudson.lifecycle.UnixLifecycle.verifyRestartable(UnixLifecycle.java:95)
    	at jenkins.model.Jenkins.safeRestart(Jenkins.java:3007)
    	at jenkins.model.Jenkins.doSafeRestart(Jenkins.java:2966)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
    	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
    	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
    	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
    	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    	at org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
    	at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
    	at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    	at hudson.plugins.collabnet.auth.CNFilter.doFilter(CNFilter.java:90)
    	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
    	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    	at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
    	at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
    	at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.akuma.CLibrary
    	at com.sun.akuma.JavaVMArguments.resolvePID(JavaVMArguments.java:126)
    	at com.sun.akuma.JavaVMArguments.ofLinux(JavaVMArguments.java:114)
    	at com.sun.akuma.JavaVMArguments.of(JavaVMArguments.java:104)
    	at com.sun.akuma.JavaVMArguments.current(JavaVMArguments.java:92)
    	at hudson.lifecycle.UnixLifecycle.(UnixLifecycle.java:54)
    	at hudson.lifecycle.Lifecycle.get(Lifecycle.java:93)
    	at jenkins.model.Jenkins.getLifecycle(Jenkins.java:1939)
    	at org.jenkins.ci.plugins.saferestart.JenkinsUtils.canRestart(JenkinsUtils.java:37)
    	at org.jenkins.ci.plugins.saferestart.SafeRestartRootAction.getIconFileName(SafeRestartRootAction.java:47)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
    	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
    	at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
    	at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
    	at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
    	at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
    	at org.apache.commons.jexl.parser.ASTNENode.value(ASTNENode.java:55)
    	at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54)
    	at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56)
    	at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
    	at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
    	at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
    	at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:71)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:97)
    	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
    	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:121)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
    	at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
    	at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
    	at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63)
    	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98)
    	at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
    	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
    	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
    	at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44)
    	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
    	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63)
    	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
    	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
    	at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:107)
    	at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:124)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:550)
    	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
    	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
    	... 28 more
    
    1. You do realize you need to restart Jenkins after you update plugins before the updated plugin is available, right? I can not reproduce the problem.

      1. Yes, of course! ;-)

        I am getting this behavior even after having manually restarted the entire instance from the command line. However, meanwhile I found out that a collegue of mine is running Jenkins 1.430 with v0.2 of SafeRestart and it works nicely also with him. I suspect there may be something wrong with my current instance, somehow.... Time to play the detective game.

          1. Huh.  I don't see how that's related to the problem (which I am also having).  Jenkins in my case doesn't restart, but it also doesn't stop, and my permissions appear to be correct:

            abrahams@boost-ci:/usr/share/jenkins$ ls -la /tmp/jna
            total 8
            drwxr-sr-x  2 jenkins root 4096 Jan 15 07:38 .
            drwxrwsrwx 11 root    root 4096 Feb 14 18:29 ..

            abrahams@boost-ci:/usr/share/jenkins$ ls -la /tmp/jna
            total 8
            drwxr-sr-x  2 jenkins root 4096 Jan 15 07:38 .
            drwxrwsrwx 11 root    root 4096 Feb 14 18:29 ..
            
            1. I'm still getting this error and I'm on 1.517 running on Ubuntu 12.04 Server (not "Desktop" but "Server").  Is it related to this bug? 

              https://issues.jenkins-ci.org/browse/JENKINS-10442

              I think the SafeRestart plugin is working as expected.  Thanks for creating this plugin :)

  4. My suggestion is that there should be a visual indication that Restart has been selected and is pending, similar to what is seen with the "Prepare for Shutdown" command.

    I am also a bit confused by the option that appears on the Manage Plugins screen when a plugin is selected for download and install on restart. There is a pre-checked check box that says restart when no jobs are running. Is this option supplied by this plugin?

    I also agree with a previous comment that the Restart Safely link on the left hand side should be removed and placed in the manage Jenkins page.   Restarting sounds like "Managing  Jenkins" to me and it would lessen the clutter on the front page.

    Thanks for your consideration.

  5. it would be nice to have some minimal documentation for this plugin - e.g. what makes this restart "safe"? how does it relate to "prepare for shutdown"? etc.

  6. I understand that the plugin waits for the running jobs to complete before restarting jenkins but i also notice the scheduled jobs queuing up. What happens to them after restart? Will they start executing automatically? 

  7. I also agree with a previous comments that the Restart Safely link on the left hand side should be removed and placed in the manage Jenkins page.   Restarting sounds like "Managing  Jenkins" to me and it would lessen the clutter on the front page.

  8. Can I make a plugin 'restart when there is no build'?

    Our system consists of many long lasting builds, so, with 'safe restart', sometimes builds are not executed even thought there was enough time to do it before restarting Jenkins.

    I want to restart if there is no build running.

     

  9. Feature request:

    There could be long running jobs, which normally do not block short running ones; but this plugin blocks latter, right?

    At least optionally it should not block new runs, but restart only when there are none running and none in the queue.

    Stephan

  10. Hi Stephan,

    Do you mean that the is such option? or I should make a new plugin?