Page 1 of 1

SSH command is not executed python

Posted: Sun Mar 12, 2017 5:46 pm
by rafbar
Hi Community

I try to control a redpitaya device over ssh using a python script. My python script looks like this:

from fabric.api import run, env

env.host_string = 'root@192.168.1.110'
env.password = 'root'
run('uptime')
run('hostname')
run('systemctl start redpitaya_scpi &')

The output in the console is:
[root@192.168.1.110] run: uptime
[root@192.168.1.110] out: 16:55:02 up 1:12, 1 user, load average: 0.02, 0.02, 0.05
[root@192.168.1.110] run: hostname
[root@192.168.1.110] out: redpitaya
[root@192.168.1.110] run: systemctl start redpitaya_scpi &
--> no out: when running the systemctl command

It seems like the uptime and hostname command worked but the systemctl command not!!

Does anybody can give me a hint where the error is??

Chrys

Re: SSH command is not executed python

Posted: Wed Mar 15, 2017 6:00 pm
by Nils Roos
Hi,
the systemctl command produces no output when it executed successfully - only in case of errors.