Hi all,
i'm trying to use a bash script to start a command.
I've associated the script to a dummy switch.
The log is ok, it seems that the script is correctly executed but the command inside the script is not executed.
When i execute the .sh script from command line it's ok.
This is the script:
#!/bin/bash
/home/pi/.rvm/gems/ruby-2.5.1/bin/midea-ac set xxxx --power=off > /dev/null &
if i remove the & at the end of the script, i see error 32512 in the log.
As you can see it's very simple but it does not work. The command i execute is the midea-ac ruby package that i've installed following the instructions from here:
https://github.com/yitsushi/midea-air-condition
Is it related to ruby permissions from Domoticz?
Can you help me?
Regards,
vrega
PROBLEM bash script does not start (ruby?)
Moderator: leecollings
-
- Posts: 15
- Joined: Wednesday 13 December 2017 10:12
- Target OS: Linux
- Domoticz version:
- Contact:
Re: PROBLEM bash script does not start (ruby?)
I've found that the problem is that the script is executed as root and not as user pi (the default raspberry user).
If i execute the script as root, it gives me the error:
/usr/bin/env: ‘ruby’: No such file or directory
If i execute the script as user pi all is ok.
Is there a way to force domoticz to execute the script as user pi or is there a way to make it work with user root?
Thank you
If i execute the script as root, it gives me the error:
/usr/bin/env: ‘ruby’: No such file or directory
If i execute the script as user pi all is ok.
Is there a way to force domoticz to execute the script as user pi or is there a way to make it work with user root?
Thank you
Who is online
Users browsing this forum: No registered users and 1 guest