I have a command service app start-demo, I need to type sudo service app start-demoin the command line.
I used sudo(service app start-demo)and sudo(sudo service app start-demo)but I still get
Warning: sudo () encountered an error (return code 1) while executing 'sudo service app start-demo'
I have no problem running this as a command line in a terminal.
I'm not sure what SADeprecationWarning:is considered a structure error?
Thank.
user@box:/var/lib/app$ fab kickstart
You are installing prereqs..........
No hosts found. Please specify (single) host string for connection: localhost
[localhost] Login password:
[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.
the code
def pserve():
print '### I am starting demo ###'
sudo('sudo service app start-demo')
or the command sudowill fail.
/etc/sudoers
Defaults env_reset
root ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
%admin ALL=(ALL) NOPASSWD:ALL
source
share