everytime I want to save a JPG from my Webcam, the file stays 1KB and won’t load => /tmp works - but I can’t mv or cp the file there…? Did I miss something?
I may be wrong, but I think the openHAB user is openhab, not openhabian. So it’s obvioius that openHAB can’t write to the home directory of openhabian. The user openhab has no home directory at all.
The user is indeed openhabian and it’s home Directory is /home/openhabian:
[20:07:28] openhabian@openHAB2:~$ cd ~
[20:08:32] openhabian@openHAB2:~$ pwd
/home/openhabian
I can execute files within this directory from inside openHAB, so I figured, I could also have write access… (at least the write right is set for the ~/webcam directory…
just as Udo an you suggested: I assumed, the openhabian user also runs openHAB, but it’s openhab indeed.
after changing permissions on ~/webcam/ it works. Thank you both!
Indeed. The openhab account is configured to prevent logins. But it is pretty handy to know that openhab’s home directory is the userdata folder. Then you can do things like
tail -f ~openhab/logs/openhab.log
I remember learning this the hard way back when. For a time the OH start script would change the permissions on ALL files and folders remotely related to OH. As a consequence shell scripts stored in ~openhab/bin would have their execute bit stripped every time OH restarted.
And for future readers, if you have shell scripts you want to execute from OH using Exec bindingin or executeCommandLine, ~openhab/bin is a better location than /etc/openhab2/scripts, the latter of which is intended for Rules scripts, not shell scripts.
Yes, that’s an important point. And of course, if someone wants to provide ssh keys to allow openHAB to control some other computers, one would only need to add ~/.ssh/ to have a perfect place to store the keys.