mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
host: Use "sh -c" for background() like execute()
Align LocalConnection.background() and LocalConnection.execute() by using "sh -c" when running with sudo.
This commit is contained in:
parent
b1538fd184
commit
bf4e242129
@ -127,7 +127,7 @@ class LocalConnection(ConnectionBase):
|
||||
password = self._get_password()
|
||||
# The sudo prompt will add a space on stderr, but we cannot filter
|
||||
# it out here
|
||||
command = "echo {} | sudo -p ' ' -S -- {}".format(quote(password), command)
|
||||
command = "echo {} | sudo -p ' ' -S -- sh -c {}".format(quote(password), quote(command))
|
||||
|
||||
# Make sure to get a new PGID so PopenBackgroundCommand() can kill
|
||||
# all sub processes that could be started without troubles.
|
||||
|
Loading…
x
Reference in New Issue
Block a user