명령이 있습니다. service app start-demo
에 명령 행에 sudo service app start-demo
을 입력해야합니다.fabric에서 sudo로 실행합니다.
나는 sudo(service app start-demo)
및 sudo(sudo service app start-demo)
사용하지만, 난 여전히
경고 얻을 : 실행하는 동안 오류 (리턴 코드 1)가 발생()는 sudo를 'sudo는 서비스 앱 데모 시작'나는 것을 실행 아무 문제가
을 터미널에서 명령 줄로.
SADeprecationWarning:
이 패브릭 실패로 간주되는 지 확실하지 않습니까?
감사합니다.
[email protected]:/var/lib/app$ fab kickstart
You are installing prereqs..........
### Install Prereqs for Populate ###
No hosts found. Please specify (single) host string for connection: localhost
[localhost] Login password:
### I am starting demo ###
[localhost] sudo: sudo service app start-demo
[localhost] out: Starting demo
Fatal error: sudo() encountered an error (return code 1) while executing 'sudo service app start-demo'
Aborting.
Disconnecting from localhost... done.
중 하나 sudo
명령이 실패합니다
def pserve():
print '### I am starting demo ###'
#with settings(warn_only=True):
sudo('sudo service app start-demo')
#sudo('service app start-demo')
코드. /etc/sudoers
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD:ALL
'sudo' 설정에서 터미널에 암호를 입력해야합니까? – sarnold
명령을 따옴표로 묶었습니까? 그것은'sudo ("service app start-demo")'이어야합니다. – mayhewr
@sarnold 그렇지 않습니다. 터미널에서'sudo '를 실행하면 묻지 않습니다. 나는 묻지도 않은 팹으로 도망 쳤다. – user423455