2012-07-05 3 views
5

명령이 있습니다. 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 
+0

'sudo' 설정에서 터미널에 암호를 입력해야합니까? – sarnold

+0

명령을 따옴표로 묶었습니까? 그것은'sudo ("service app start-demo")'이어야합니다. – mayhewr

+0

@sarnold 그렇지 않습니다. 터미널에서'sudo '를 실행하면 묻지 않습니다. 나는 묻지도 않은 팹으로 도망 쳤다. – user423455

답변

3


은 prolly faq이 언급과 관련이뿐만 아니라 명령 (모든 이익을 위해 유닉스 표준) 0을 반환하지 않는 경우 실패 빠른 것입니다하지 않는 한 당신은 단지 경고하라고 말한다.

+0

Thansk! 그것은 아주 좋은 발견입니다 :) 이제 .. 한가지 더 ... 팹이 돌아 오지 않습니다. 그냥 거기에서 기다립니다. 왜 그런가요? – user423455

+0

FAQ (FAQ 참조) (http://docs.fabfile.org/ko/1.4.2/faq.html#why-can-ti-run-programs-in)에서 일부 기능이 없거나 배경이 뒤죽박죽 된 것이 원인 일 가능성이 큽니다. - 배경 -와 - 그것 - 만드는 - 직물 - 교수형) – Morgan

관련 문제