HOWTO Stop, start, restart openhab running on openhabian?

I know this a very noob question but:
sudo service openhab stop
returns unknown service, SO… How do I stop the OH service on an openhabian installation? Is it called something else?


I am not on PC now to get the exact name, but it should be something like openhab2.service

So you could start stop or restart it in a ssh connection with

sudo systemctl restart openhab2.service

When the name is correct auto complete should work, when you typed in a part of the name.


OH TYSM, I’m sure I should write that down. this has been bothering me all day


You can also easily create an alias for yourself by simply editing .bashrc file:

[13:35:51] user@youropenhabian:~$ sudo nano .bashrc

And add a line at the very bottom of the file:

alias restartoh='sudo systemctl restart openhab2.service'

Save it and you’re ready to go :wink:


HMM, That’s neat. I can definitely think a few other use cases for that . Thanks

That is strange!
When I’ve upgrade my Openhab 3.1 to → Openhab 3.2 my .bashrc fil this alias had been commented out!
How-to work around every time I update my OpenHab !!??

The command changed to the following (no ‘2’ anymore…)

sudo systemctl restart openhab.service
1 Like