Moving installation to OpenHabian

I have a mature OpenHAB2 / nginx system running on a fanless Intel Based mini PC with SSD. Alongside it is Open Energy Monitor in low disk write mode, and I’ve moved the logs and persistance to a RAM Disk with a script that copies persistance back to the SSD on reboot. It works well, and degragation of the SSD is around 1% per year. Upgrades however are long winded with:

  • switch to USB booting together with a visit to the BIOS
  • booting Acronis and taking a disk image
  • rebooting normally
  • apt-get update followed by an apt-get update
  • reboot
  • edit the Openhab user and group in the Service file
  • reboot

Would moving to OpenHabian help with any of this, or would it likely conflict with my existing nginx setup and Open Energy Monitor which includes Apache, its own database engine, redis, php, mysql and Mosquitto.

Not sure what all of this is doing? Can you clarify what updates take a long time? Also what os are you running?

I run apt update all the time usually runs in the background and take a couple mins. In fact you can even run it unattended if desired. I am also unclear why you have to modify the openHAB user?

  1. Backup - been caught out too many times to not do this, last updates issue was an easily sorted timing problem that broke open energy moniitor
  2. The updates are usually pretty quick assuming everything comes up gracefully afterwards
  3. 64Bit Debian

In the beginning back in the OH 1.x days the OpenHAB user and OpenHAB group combination didn’t have rights to talk to my RFXCOM and 1-Wire Dongles, despite adding them to the DIALOUT group. As I knew very little about Linux back, and the system was behind a firewall I simply created a user with the required rights. Unfortunately everytime OH updates it changes the service file back to defaults which don’t have rights to the log directory and likely other directories too. Sorting this is on my todo list, but I wonder whether reverting to a standardish installation is a better bet long term which is the reason for this thread.
As an aside I’d thought that encouraging everyone to use the same user and group isn’t great from a security point of view

Not knowing your full setup, I would separate openHAB as a separate install. It seems between the backups and the energy monitor the one system is quite complex.

I would separate openHAB to a separate computer/vm/pi. If you use a pi then yes openhabian image is the way to go.

On backups, it looks as if the reboot to make a full backup is causing issues can acronis not run as a service in the background ? Either way if openHAB is on it’s own you can run the backup script to copy your config. A whole disk image is nice to have, but that can be done less frequently. I run my pi 3 on ssd it has been solid for a year now. I don’t use RAM disk, just didn’t feel like setting it up. The ssd I use I use the same brand (intel) at work and we haven’t lost one. We write thousands of files daily and I have drives that have been running for years. That said I do a full disk image quarterly at best, usually a couple times a year when openHAB or some other supporting app update major versions.
The rest of the time it’s config only.

The backup solution that comes with openHABian does not require to shut it down.
But it depends on what you want to move to, and you fail to state that. You even don’t mention what OS you run.
Do you want to move to RPi hardware ? If not that all depends on how you setup your HW and OS because openHABian won’t do the OS setup for you on non-RPi.

nginx is an optional install in openHABian but about OEM nobody knows. You would need to try yourself.

1 Like

I’m running 64bit Debian and am happy with my current hardware. I outgrew my Pi3 sometime ago.
From the replies so far it seems like I should stay with my current setup.
Is there any documentation around about the openHAB user and the OpenHabian backup solution? That’s the main improvements it seems I could make from a maintenance point of view.

You could manually install openHABian on your Debian and selectively only install Amanda (the backup tool) from the openhabian-config menu.
I don’t know what you refer to about the openhab user. Normally there is no need to edit anything.

Disadvantage of RPI is that all data is continuously written to the SD card. My experience is that the SD card fails sooner than later.
Therefor I moved to a Intel NUC system which is more stable and faster. More or less your situation.
To cope with updates that break my current installation, I use ProxMox as hypervisor which works well for snapshots. Base OS is Debian.
Disadvantage of my setup is that I cannot directly connect other devices via USB or GPIO. Until now this has not been a showstopper for me.
Perhaps that ProxMox is a possibility for you as well.

To confirm I can simply load OpenHabian and just install the bits I require without upsetting my current version of OpenHAB?

Not being able to access USB wouldn’t work for me as I have 2 USB dongles. Thanks for the info

yes

it will not auto-install or auto-upgrade anything but remember openHABian is built to be installed on a virgin OS. So given noone but you knows what you already changed on your system it may work out or not.

1 Like

openHAB’s apt installation should do this for you now, the openhab user becomes a member of both dialout and tty groups.

I’m not sure if I understand this comment. The openhab user in this case only exists as a system user within your Linux install, it should (and is under normal circumstances) only used by the openHAB runtime to operate within its own filesystem. You cannot log into it as you would do with a real Linux user.

gpio too ? Just asking as we do that in the permissions_correction() routine but it really should be there in the package from day 1.

… on an effectively single (human) user system so a lot of the UN*X security “wisdom” doesn’t apply.

I’ve just changed the default user back to openhab and after some tweaking of permissions scattered around the system everythings working, although after a few hours the system hung which is very rare

Thanks for the clarification

No, but it probably should be! Currently the openhab2 packages adds the openhab user to the bluetooth, tty, dialout, and audio groups only.

1 Like