增加Jenkins登录超时 [英] Increase the Jenkins login timeout

查看:404
本文介绍了增加Jenkins登录超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道在Jenkins注销用户之前如何增加超时窗口吗?我希望将其提高到1天左右.

Does anyone know how to increase the the timeout window before Jenkins logs out a user? I'm looking to raise it to 1 day or so.

我整天进出詹金斯,我们在两次工作之间一直注销.令人沮丧的是,保持登录状态"复选框似乎也不起作用.

I work in and out jenkins all day and we keep getting logged out between running of jobs. Added to this frustration, the 'stay logged in' checkbox doesn't seem to work either.

推荐答案

Jenkins使用Jetty,并且

Jenkins uses Jetty, and Jetty's default timeout is 30 minutes. This is independent of authentication settings -- I use Active Directory but it's still this setting that affects timeouts.

您可以通过将参数--sessionTimeout=<minutes>传递给Jenkins初始化脚本,或将-DsessionTimeout=<minutes>传递给.war文件来覆盖超时.例如:

You can override the timeout by passing an argument --sessionTimeout=<minutes> to the Jenkins init script, or -DsessionTimeout=<minutes> to the .war file. For example:

# Set the session timeout to 1 week
$ java -jar jenkins.war --sessionTimeout=10080

或者,您可以编辑Jenkins的<jenkinsHome>/.jenkins/war/WEB-INF/web.xml并添加明确设置的内容:

Alternatively, you can edit Jenkins' <jenkinsHome>/.jenkins/war/WEB-INF/web.xml and add explicitly set it:

<session-config>
  <!-- one hour -->
  <session-timeout>60</session-timeout>
</session-config>

根据 Oracle的文档您可以将其设置为0以完全禁用超时.

According to Oracle's docs you can set this to 0 to disable timeouts altogether.

要找出超时的当前值,可以使用Jenkins中提供的Groovy控制台:

To find out the current value for timeouts, you can use the Groovy console provided in Jenkins:

import org.kohsuke.stapler.Stapler;
Stapler.getCurrentRequest().getSession().getMaxInactiveInterval() / 60

在我的实例上,显示为Result: 30.

On my instance, this shows Result: 30.

这篇关于增加Jenkins登录超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆