반응형
젠킨스에서 서비스를 중지, 재시작 하는 명령을 실행시키면 아래와 같은 오류가 발생합니다.
a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
반응형
젠킨스에서 특정 서비스를 실행하는것에는 방화벽에 의한 포트 문제등 다른 이유야 많겠지만 위 현상은
그냥 특정 유저가 특정 명령어를 실행할 때 sudo 의 비밀번호를 묻지 않도록 설정해서 이를 해결할 수 있습니다.
젠킨스 shell에서 아래 커맨드 추가해서 sh 실행주체와 systemctl 경로 확인
whoami
which systemctl

sudoers 편집
sudo visudo /etc/sudoers


jenkins ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop dbserver
jenkins ALL=(ALL) NOPASSWD: /usr/bin/systemctl start dbserver
jenkins ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart dbserver
jenkins ALL=(ALL) NOPASSWD: /usr/bin/systemctl status dbserver
반응형
LIST
'IT > 개발환경' 카테고리의 다른 글
유용한 젠킨스 플러그인 (0) | 2024.03.06 |
---|---|
맥 homebrew jenkins 설치/재설치 (0) | 2024.03.06 |
teamcity 에서 .node log 한글 깨짐 해결방법 (0) | 2023.08.22 |
팀시티 유저에게 프로젝트별 세부권한 부여하는 방법 (0) | 2023.07.27 |
윈도우에서 git 명령어 사용시 fatal: credential-cache unavailable; no unix socket support 오류 해결 (0) | 2023.07.27 |