zzzz
(Augis)
August 25, 2017, 6:35pm
1
Hello, so I need to execute a command
sudo reboot
in my rules file so here is what I’m working with
rule "raspi reboot"
when
Item raspirr received update
then
//Right here i need to execute "sudo reboot"
end
Any help will be highly appreciated.
Toneus
(TonyC)
August 25, 2017, 6:44pm
2
Would the EXEC binding work here?
Check out this thread
zzzz
(Augis)
August 25, 2017, 6:58pm
3
Could you give me a detailed guide how to use it? I’m new with the Exec Binding
And I would rather prefer doing it in the rules something like executeCommandLine(“sudo reboot”)
rlkoshak
(Rich Koshak)
August 25, 2017, 9:14pm
4
So have you actually tried doing that?
http://docs.openhab.org/addons/bindings/exec/readme.html
With either approach, when you encounter problems:
One of the most common problems I help people with on this forum is dealing with the Exec binding. So I’m writing this post so I can reference it later.
Background
When openHAB is installed in the automated way (i.e. via apt-get) an openhab user is created and the service runs under that user. The openhab user has the following attributes:
no shell so one cannot log in or su to this user
limited rights
not a member of sudoers
has a home directory in /var/lib/openhab (or /var/lib/openhab2)
has…
1 Like
zzzz
(Augis)
August 26, 2017, 7:37am
5
Yes, I have and I also tried doing this
I’ve just added a rule that allows OpenHAB uptime to be displayed in a human readable format, and also reboot the system in the middle of the night once it has been up for over 7 days. As I’m doing a lot of work on the system I’ve steered away from a simple cron style reboot, and intend extending the time between reboots once I know how long it can go before it has problems. Before updating to OH2 it needed to reboot twice a week to prevent the user interface from throwing can’t read sitemap typ…
didn’t seem to work.