Hi i am not a big Linux guy so please be gentle i am trying to switch from windows to Linux so maybe i missed some Prerequisites
i have set up a VM with 16.04 with all the good stuff node-red, sql,openhab Mosquito
but i am not able to start OH with the service and Docs are getting me nowhere, so please help
my username is openhab for the linux install!(little confusing)
i have nothing in ```WorkingDirectory=/opt/openhab2
when i do changes should i do sudo or sudo bash
when i try i get service erros like this
Sep 01 09:01:18 ubuntu systemd[1]: [/lib/systemd/system/openhab2.service:12] Exe
~
You did not mention Java (you have to install Java 8, either Zulu or Oracle)
Can you startup openHAB manually (this would fail if no Java is installed yet)
Even if you are no Linux guy I recommend to use debian (stretch) in favor of Ubuntu, especially when running it as a VM. You don’t want to use a graphic interface, do you? As openHAB should be run on a headless system, don’t install all that graphical overhead, you won’t need it and it won’t give you any benefit.
If starting from scratch, the commonly used user for login to the machine should be a real user (e.g. gadofir or uhartmann or whatever fits) The user openhab is registered when installing openHAB2, and this user should not be able to use a bash, so there is no password set and bash is /bin/false
If installing openHAB2 through apt (and this is the recommended way), there is no directory /opt/openhab2 at all
ubuntu prevents to login as root, and therefor makes use of sudo to provide a way to do things as user root. The command is
sudo command
and this is the same as doing that:
su //login as user root
command //execute the command
exit //leave the root bash
If you want a root bash to work with, you should use
sudo su -
which is: “Login as user root and change to it’s home directory.”
if it helps i am using this to start sudo /etc/init.d/openhab2 start
and after all that i did not understand if i need to change something in my home or working directory
But there is no UI … In fact, it’s way more complex to use the GUI packet manager as to use
apt install <the-packet>
In question of openHAB, the UI comes through the web browser, no need for any GUI.
In ubuntu as in every other *nix-like OS, you always need some console commands.
sudo /etc/init.d/openhab2 start
well, this is the old init script for system-v-startup system. I’m not sure if ubuntu 16.04 comes with systemd or upstart as startup-system. A possible solution could be to use upstart, but this is command line only configuration, and I doubt that there is an official upstart script (upstart is deprecated, ubuntu comes with systemd since ~ 17.04, afaik). another solution could be to use the init script by using
sudo update-rc.d openhab2 defaults
but I don’t know if ubuntu will accept this to startup openHAB at boot.
Maybe you want to try
openHABian as installation method:
Setup a VM with debian netinst iso 1GByte RAM, 1CPU, 10GByte HD, Bridged Network
start the vm, install with standard options (i.e. only chose a root password, a standard user (not openhab) and a password for the standard user.
login to the new VM by using the user root
apt update && apt -y full-upgrade
apt install sudo git
adduser <standarduser> sudo
ip a
remember the ip for the ethernet (commonly 192.168.x.y)
logout
login to the vm by using putty and the standard user.
Then install openhabian-config:
# download and link
sudo git clone https://github.com/openhab/openhabian.git /opt/openhabian
sudo ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config
# execute
sudo openhabian-config
Chose 60 | manual/fresh setup, execute all entries one after the other (you can omit 61 | update as we did it in step 4)
You may say “Oh, this is far too complex!”, but in fact this is really step-by-step and it’s really easy.
If you don’t want to use putty, you can use the VM console instead, but be aware that you can’t adjust the resolution (with putty just change width and hight of the putty window) and you can’t use the clipboard (in putty just mark text to get it in clipboard or right-click to paste the contents of the clipboard).
Lets try to fix this OS pleaseee
i am using the gui for more stuff like mysql workbench, node red
i can do all this remotely but i want to be able to do it on site also(if no network is available )
please tell me if i got you right
sudo update-rc.d openhab2 defaults if you can please explain…
sudo systemctl enable openhab2
sudo systemctl start openhab2
It won’t work, but this is because the default service file has been replaced by something non-standard, /lib/systemd/system/openhab2.service isn’t provided by the package but /usr/lib/systemd/system/openhab2.service is.
Somewhere along the line, instructions were followed meant for another system, but this is not a problem. We can get openHAB working again with systemd by: