Both are special limited account that do not allow one to login. You have to ask permission to run commands as either of these users. That is what sudo is for.
sudo ls means “run the ls command as user root”. Sudo will then as for your password and if your user is allowed to run ls as root it will run the command as root.
When these commands are successful they don’t generate any result. But when you look at the file you should see that it is now owned by openhab and has execute permissions.
pressing the switch that fires the script returns error
2018-08-02 19:31:13.427 [ome.event.ItemCommandEvent] - Item 'Kodi_Rescan' received command ON
==> /var/log/openhab2/openhab.log <==
2018-08-02 19:31:13.488 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/home/openhabian/Kodi_rescan.sh" (in directory "."): error=2, No such file or directory)
I’m starting too feel out of my depth here but hopefully soon it will get cracked and i will have learned new stuff
This is a problem. Don’t change the group ownership, otherwise the user openhabian (which is member of the group openhabian) can’t access his files anymore.
Please revert via:
sudo chown openhab:openhabian kodi_rescan.sh
Now your file isn’t there, where you told openHAB.
2018-08-02 19:52:52.199 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/home/openhabian/Kodi_rescan.sh" (in directory "."): error=2, No such file or directory)
I still cant edit the file from windows i can before running any permission commands its not much of a problem not being able too edit the file aslong as it runs i will look at my rule again
no response from command line file now editable with windows again
so whats wrong with my rule it looks fine too me others have said it still works too
rule "Kodi Video Library Scan"
when
Item Kodi_Rescan received command
then
val result = executeCommandLine("/home/openhabian/Kodi_rescan.sh", 5000)
logInfo("Kodi Library Scan", result)
end
i get even worse results when putting it in that folder i have tried allready but for the sake of arguments i will try again …
same result
2018-08-02 20:19:40.240 [WARN ] [lipse.smarthome.io.net.exec.ExecUtil] - Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/etc/openhab2/scripts/Kodi_rescan.sh" (in directory "."): error=2, No such file or directory)
edited rule too
rule "Kodi Video Library Scan"
when
Item Kodi_Rescan received command
then
val result = executeCommandLine("/etc/openhab2/scripts/Kodi_rescan.sh", 5000)
logInfo("Kodi Library Scan", result)
end
my head is starting too hurt from all the banging on the wall lol