bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.57k stars 499 forks source link

Start ssh from Companion Pi[BUG] #2802

Closed FirelightLokeren closed 6 months ago

FirelightLokeren commented 6 months ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

I have created a button with action "internal: System: Run shell path (local)" path : ssh >> /home/pi/test.log 2>&1

I get the error message in the log and the test.log file is not created 24.03.15 17:11:48 Internal/System: Shell command failed. Guru meditation: {"code":2,"killed":false,"signal":null,"cmd":"ssh >> /home/pi/test.log 2>&1"}

When I run the command from the terminal console an SSH session is started and the test.log file is created pi@CompanionPi:~ $ ssh >> /home/pi/test.log 2>&1 pi@CompanionPi:~ $ cat test.log usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] destination [command] pi@CompanionPi:~ $

When I do this on companion running on a windows machine then the ssh is working. I suspect that the SSH is not triggerd

Steps To Reproduce

No response

Expected Behavior

No response

Environment (please complete the following information)

- OS:
- Browser:
- Companion Version:

Additional context

No response

istnv commented 6 months ago

Shell commands do not always have a default command path defined. Enter the full path to the ssh command: /usr/bin/ssh

Julusian commented 6 months ago

ssh >> /home/pi/test.log 2>&1 could also be failing because the companion user doesnt have write access to /home/pi by default

FirelightLokeren commented 6 months ago

Hi,

I finaly solved my problem by forcing pseudo-tty allocation.

The command I was using was ssh pi@ndi-monitor-05 /home/pi/Script/reboot.sh and then noting was happening. When I use ssh -t pi@ndi-monitor-05 /home/pi/Script/reboot.sh the reboot script on ndi-monitor-05 is executed.