詹金斯在重新启动我的SQL&QUOT失败;须藤:没有TTY present和指定对不起没有askpass程序,再试一次" [英] jenkins fails while restarting my sql "sudo: no tty present and no askpass program specified Sorry, try again."

查看:506
本文介绍了詹金斯在重新启动我的SQL&QUOT失败;须藤:没有TTY present和指定对不起没有askpass程序,再试一次"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚配置詹金斯和pre-构建步骤我试图重新启动詹金斯,但我结束了以下错误

 开始修订c5b9f8daac092efc5396d80f568a2cf89ae8b697(产地/ HEAD,产地/主站)的建设
签出修订c5b9f8daac092efc5396d80f568a2cf89ae8b697(产地/ HEAD,产地/主)
未更改记录分支来源/ HEAD
未更改记录分支来源/主
[Web应用程序] $ / bin / sh的-xe /tmp/hudson5215632082686866774.sh
+须藤/etc/init.d/mysql重启
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:没有TTY present并没有指定askpass程序
对不起,再试一次。
须藤:3不正确的密码尝试
构建步骤执行shell标记建设成为失败
表面处理:失败
 

我用Google搜索,发现一些答案的<一个href="http://stackoverflow.com/questions/13263367/jenkins-out-of-nowhere-starts-failing-with-sudo-no-tty-$p$psent-and-no-askpass-p">Jenkins从哪儿冒出来开始失败使用sudo:没有TTY present和

指定任何askpass程序

但遗憾的是没有帮助我

我的/ etc / sudoers文件看起来像这样

 #
#此文件必须进行编辑与'visudo命令命令,作为根。
#
#请考虑/etc/sudoers.d/而不是增加本地内容
#直接修改该文件。
#
#参见手册页关于如何写sudoers文件的细节。
#
默认env_reset
默认secure_path =在/ usr / local / sbin中:在/ usr / local / bin目录:/ usr / sbin目录:在/ usr / bin中:/ sbin目录:/ bin中

#主机别名规范

#用户别名规范

#CMND别名规范

#用户特权规范
根ALL =(ALL:ALL)ALL

管理员组的成员#可能获得root权限
%管理ALL =(ALL)NOPASSWD:ALL

#允许须藤组的成员来执行任意命令
%须藤ALL =(ALL:ALL)ALL

#见sudoers的(5)上的#包括指令的详细信息:

#includedir /etc/sudoers.d
 

解决方案

通过添加以下内容: 默认值:用户名进行身份验证 到/ etc / sudoers文件 你不应该得到的错误,但这个用户名可以访问不要求输入密码

I just configured jenkins and in the pre-build steps i am trying to restart jenkins but i end up with the following error

Commencing build of Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
Checking out Revision c5b9f8daac092efc5396d80f568a2cf89ae8b697 (origin/HEAD, origin/master)
No change to record in branch origin/HEAD
No change to record in branch origin/master
[webapp] $ /bin/sh -xe /tmp/hudson5215632082686866774.sh
+ sudo /etc/init.d/mysql restart
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Build step 'Execute shell' marked build as failure
Finished: FAILURE

I googled and saw some answers at Jenkins out of nowhere starts failing with sudo: no tty present and no askpass program specified

But unfortunately that didn't help me

My /etc/sudoers looks like this

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

解决方案

By adding the following: Defaults:username !authenticate to your /etc/sudoers you should not get the error but this username will be accessible without asking for a password

这篇关于詹金斯在重新启动我的SQL&QUOT失败;须藤:没有TTY present和指定对不起没有askpass程序,再试一次&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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