nir0s/serv

Can't execute command with "sudo"

Opened this issue · 2 comments

I need to run a command with sudo.
When I try to pass command as "sudo cmd" it says it can't be found.

sudo serv generate "sudo vault" --name vault --args '-config=/opt/vault.hcl' --deploy --start
INFO - Generating upstart files for service vault...
INFO - Generated /tmp/upstart-vault/vault.conf
INFO - Deploying upstart service vault...
ERROR - Executable sudo vault could not be found.
nir0s commented

It's generally not a good practice to run things with sudo like. That being said, we can add a prefix flag which will allow to run something like

serv generate /usr/bin/python2 --args ... --prefix 'su -e' ...
nir0s commented

This will not be solved in 0.3.0. Will leave it for 0.4.0.