I’am trying to implement a button on the OpenHAB UI to restart OpenHAB. I’ve tried several exec statements, but OpenHAB doesn’t start again after shutting down. I’ve also tried this command line with no success:
Assuming you are on a RasPi running wheezy or any other system that uses Upstart (e.g. Ubuntu 14) the command would be:
sudo service openhab restart
Assuming you are on a RasPi running jessie or any other system that uses systemd (e.g. Ubuntu 15) the command would be:
sudo systemctl restart openhab.service
Note in both cases you have to use sudo which requires a password so you should configure your sudoers to not require the openhab user to require a password when running systemctl (probably not the best security decision but it could be worse).