openHABian hassle-free openHAB Setup

I tried out today:

git clone -b openHAB3 https://github.com/openhab/openhabian.git /opt/openhabian
root@ohtest:/opt/openhabian# cat openhabian.conf.dist 
# Modify your openHABian settings
# Handle with care, only touch if you need to!!
# This file will only be used on unattended initial install.
# If you want to change anything after unattended install completed, use menu in openhabian-config.

# Hostname to set this one to
hostname=openhabian
# if it exists, the default user (with its working environment) will be renamed to this username given here ...
username=openhabian
# ... and given this password. The password will be removed from this file after completion for security reasons.
userpw=openhabian
# set this to download a SSH key and authorize the owner to login as the admin user
adminkeyurl=""

# Language and timezone. See Debian documentation for valid values.
timezone=Europe/Berlin
locales="en_US.UTF-8 de_DE.UTF-8"
system_default_locale="en_US.UTF-8"

# WiFi settings. An ethernet connection is recommended.
# If you have a RPi4, RPi3, RPi0W or a supported external WiFi dongle, the WiFi
# interface can be setup and used for the initial installation.
# Fill in your SSID and password below, leave empty or put comment in front to
# have your WiFi remain unchanged/uninitialized. Make sure your Ethernet works.
# ATTENTION: you need to escape these special characters: $, `, ", \, (newline)
# 'Escaping' means to put an additional \ in front of that character
wifi_ssid=""
wifi_password=""

# Wi-Fi setting. Select a two-letter country code suitable for your location
# E.g. US (default), DE, AU, NZ...
# You may infringe on local legislature otherwise
# See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 or /usr/share/zoneinfo/zone.tab
wifi_country=""

# Eventually disable all IPv6 e.g. on installation problems
# values: "enable", "disable"
ipv6=enable

# repo and branch to clone from
repositoryurl=https://github.com/openhab/openhabian.git
clonebranch=openHAB3

# debug verbosity mode
# off, on (verbose output in log) or maximum (show every command)
debugmode=off

# fake hardware
# force treating your box as if it was a ...
# pi4, pi4_8gb, cm4, pi400, pi3, cm3, pi3+, cm3+, pi2, pi1, cm1, pi0, pi0w
#hw=pi4

# Hardware architecture
# x86_64, amd64, armv6l, armv7l, aarch64, arm64
#hwarch=armv7l

# OS distribution/release
# Valid arguments: raspios, raspbian, debian, ubuntu, stretch, buster, bionic, focal
#osrelease=buster

# Java architecture mode
# Valid arguments: "Adopt11", "Zulu11-32", or "Zulu11-64"
java_opt=Zulu11-32

# openHAB Log Viewer (frontail) theme
# Valid arguments: "light", "dark"
frontailtheme=light

# install zram per default, set to "disable" to skip installation
zraminstall=enable

# start comitup hotspot if internet is not reachable
hotspot=enable

# external SD card device to backup and mirror the internal SD card to
#backupdrive=/dev/sda
storageconfig=openhab-dir
storagedir=/storage
storagetapes=15
storagecapacity=1024

# mail relay settings
#adminmail=john.doe@foo.bar
#relayuser=john.doe@foo.bar
#relaypass=secret
#smarthost=smtp.gmail.com
#smartport=587

# Tailscale VPN
#preauthkey=tskey-xxxxxxxxxxxxxxxxx

# Custom log files
#custom_log_files=("/var/log/foo.log" "/var/log/bar.log")

# vim: filetype=sh
root@ohtest:/opt/openhabian# 

w/r to commented and unchanged entries in conf File

I do get a local clone as described be executing all these commands just now while typing this message.

git clone -b openHAB3 https://github.com/openhab/openhabian.git /opt/openhabian

This seems to work fine at least I do get something from Git

Next command should not have effect .conf File as it “just” creates a link (but for sure it’s executed)

ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config

Last command before applying changes to conf File is the copy if itself from Git sources

cp /opt/openhabian/build-image/openhabian.conf /etc/openhabian.conf

Once this local copy (of the copy from Git) it opended to apply changes it looks different to the one from Git and does contains many # where spaces are missing and even more the local clone from Git at /opt/openhabian/build-image/openhabian.conf already looks different to me.

Sample extract of local file /opt/openhabian/build-image/openhabian.conf

> GNU nano 5.4                                  /opt/openhabian/build-image/openhabian.conf                                            
> # values: "enable", "disable"
> ipv6=enable
> 
> # repo and branch to clone from
> repositoryurl=https://github.com/openhab/openhabian.git
> clonebranch=openHAB3
> 
> # debug verbosity mode
> # off, on (verbose output in log) or maximum (show every command)
> debugmode=off
> 
> # fake hardware
> # force treating your box as if it was a ...
> # pi4, pi4_8gb, cm4, pi400, pi3, cm3, pi3+, cm3+, pi2, pi1, cm1, pi0, pi0w
> #hw=pi4
> 
> # Hardware architecture
> # x86_64, amd64, armv6l, armv7l, aarch64, arm64
> #hwarch=armv7l

If you look to same lines on Git

> # Origin: openhabian.conf
> 
> #
> 
> # Modify your openHABian settings
> 
> # Handle with care, only touch if you need to!
> 
> # This file will only be used on unattended initial install.
> 
> # If you want to change anything after unattended install completed, use menu in openhabian-config.
> 
> # Hostname to set this one to
> 
> hostname=openhabian
> 
> # if it exists, the default user (with its working environment) will be renamed to this username given here ...
> 
> username=openhabian
> 
> # ... and given this password. The password will be removed from this file after completion for security reasons.
> 
> userpw=openhabian
> 
> # set this to download a SSH key and authorize the owner to login as the admin user
> 
> adminkeyurl=""
> 
> # Language and timezone. See Debian documentation for valid values.
> 
> timezone=Europe/Berlin
> 
> locales="en_US.UTF-8 de_DE.UTF-8"
> 
> system_default_locale="en_US.UTF-8"
> 
> # WiFi settings. An ethernet connection is recommended.
> 
> # If you have a RPi4, RPi3, RPi0W or a supported external WiFi dongle, the WiFi
> 
> # interface can be setup and used for the initial installation.
> 
> # Fill in your SSID and password below, leave empty or put comment in front to
> 
> # have your WiFi remain unchanged/uninitialized. Make sure your Ethernet works.
> 
> # ATTENTION: you need to escape these special characters: $, `, ", \, (newline)
> 
> # 'Escaping' means to put an additional \ in front of that character
> 
> wifi_ssid=""
> 
> wifi_password=""
> 
> # Wi-Fi setting. Select a two-letter country code suitable for your location
> 
> # E.g. US (default), DE, AU, NZ...
> 
> # You may infringe on local legislature otherwise
> 
> # See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 or /usr/share/zoneinfo/zone.tab
> 
> wifi_country=""
> 
> # Eventually disable all IPv6 e.g. on installation problems
> 
> # values: "enable", "disable"
> 
> ipv6=enable
> 
> # repo and branch to clone from
> 
> repositoryurl=https://github.com/openhab/openhabian.git
> 
> clonebranch=openHAB3
> 
> # initial openHAB configuration to import (URL or filename)
> 
> # the file needs to be a zip archive created from openhab-cli backup
> 
> # initialconfig=/boot/initial.zip
> 
> # debug verbosity mode
> 
> # off, on (verbose output in log) or maximum (show every command)
> 
> debugmode=off
> 
> # the framebuffer on RPi is enabled by default
> 
> framebuffer=enable
> 
> # fake hardware
> 
> # force treating your box as if it was a ...
> 
> # pi4, pi4_8gb, cm4, pi400, pi3, cm3, pi3+, cm3+, pi2, pi1, cm1, pi0, pi0w, x86
> 
> # hw=
> 
> # Hardware architecture
> 
> # x86_64, amd64, armv6l, armv7l, aarch64, arm64
> 
> # hwarch=
> 
> # OS distribution/release
> 
> # Valid arguments: raspios, raspbian, debian, ubuntu, stretch, buster, bionic, focal
> 
> # osrelease=

I think I got it… -b openHAB3 tells git to load the old branch. Seems the documentation is outdated… just omit -b openHAB3 to get the main branch

1 Like

No more, I’ve just forwarded the main branch (which does not have the issue) to openHAB3.
Good find, thanks.

1 Like

:You’re welcome :slight_smile:

1 Like

Thanks to all of you and I just gave it a try to check it out. Even it might work with omitted I trust you like to have it working with that as well.

I run into other Fails now :-/

2021-09-26_18:13:47_CEST [openHABian] Installing selected openHAB3 version… FAILED (update apt lists)
2021-09-26_18:14:22_CEST [openHABian] Installing Frontail prerequsites (NodeJS)… FAILED
2021-09-26_18:14:26_CEST [openHABian] Applying file permissions recommendations… FAILED (please execute after openHAB is installed

w/r to

update apt lists

I run

apt-get update
apt-get install git

before installing openHABian :wink:

There is another problem with the zulu public key. Maybe bullseye has a different (old…) command:

oot@openhabtest:~# apt update
Hit:1 http://ftp.debian.org/debian bullseye InRelease
[...]
Err:8 https://repos.azul.com/zulu/deb stable InRelease                           
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B1998361219BD9C9
Hit:9 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Reading package lists... Done                    
W: GPG error: https://repos.azul.com/zulu/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B1998361219BD9C9
E: The repository 'https://repos.azul.com/zulu/deb stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

get the key:

root@openhabtest:~# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.MvSDOhtwIH/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
gpg: key B1998361219BD9C9: public key "Azul Systems, Inc. (Package signing key.) <pki-signing@azulsystems.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
root@openhabtest:~# apt update
Hit:1 http://ftp.debian.org/debian bullseye InRelease
[...]
Get:10 https://repos.azul.com/zulu/deb stable/main amd64 Packages [101 kB]
Fetched 106 kB in 1s (165 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

After that, openhabian-config does work as intended within the LXC Container.

So, obviously, openhab-config uses another method to import the key. What part is missing in bullseye?

I do run into same issue from openHABian hassle-free openHAB Setup - #1501 by INT5749 even with

git clone https://github.com/openhab/openhabian.git /opt/openhabian

As said…

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9

will import the key needed for successful installation of zulu11.

1 Like

Haven’t brougth this in relation to missing OH Installation and while there was no error with Installation of Zulu.

Anyway. importing the Zulu Key before Installation of openHABian finally solved this.

MANY thanks to all of you!!

openHABian is not yet supported on bullseye. I am not aware of any issue with buster .

The mosquitto service fails to start when a mirrorSD (obtained with option 52) boots (openhabian 1.6.5 branch main).

I switched to OH3 last month and I set up the auto-backup feature, as it is very handy. When I tried to verify if the mirrorSD worked I found that the mosquitto service was unable to start, and therefore all mqtt items were not updated.

The status of mqtt is

:~ $ sudo systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-10-02 18:20:54 CEST; 5h 53min ago
     Docs: man:mosquitto.conf(5)
           man:mosquitto(8)
  Process: 699 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
 Main PID: 699 (code=exited, status=1/FAILURE)

Oct 02 18:20:54 oh3-devel systemd[1]: mosquitto.service: Service RestartSec=100ms expired, scheduling restart.
Oct 02 18:20:54 oh3-devel systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Oct 02 18:20:54 oh3-devel systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.
Oct 02 18:20:54 oh3-devel systemd[1]: mosquitto.service: Start request repeated too quickly.
Oct 02 18:20:54 oh3-devel systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Oct 02 18:20:54 oh3-devel systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker.

This can be fixed by using “fixing permissions” with option 14 in openhabian-config. then by restarting the service everything runs regularly.

This behavior can be reproduced starting from a fresh install of openhabian 1.6.5 on my raspberry pi v3.
After installation of mosquitto with openhabian-config the service starts correctly.
Mirroring of the SD gives no error (I have set log to maximum). When booting from the mirrored SD everything seems fine but the mosquitto service does not start.

I am a bit surprised that a mirror copy has different permissions: what else can also be different?

Error in Fix Permission (option 14) in openhabian 1.6.6 (branch=main)

In my production system I am still experiencing the problem described in my previous post, i.e. Mosquitto fails to start, moreover, the workaround of fixing permissions does not work anymore with the new version of openhabian. I let openhabian to update itself but after applying option 14 it simply return to the prompt.

In order to reproduce the issue in controlled conditions, I started with a freshly downloaded openhabian image and let it install (I did it twice, with an old and a brand new 16Gb SD card). Applying option 14 fix permission always end up in an error. This happens either if mosquitto is installed or not.

In the following the relevant part of the log obtained with debug= maximum

OK
+ case "$choice2" in
+ permissions_corrections
+ local gpioDir=/sys/devices/platform/soc
+ groups=("audio" "bluetooth" "dialout" "gpio" "tty")
+ local groups
+ openhabFolders=("/etc/openhab" "/var/lib/openhab" "/var/log/openhab" "/usr/share/openhab")
+ local openhabFolders
+ local openhabHome=/var/lib/openhab
+ local backupsFolder=/var/lib/openhab/backups
+ local retval=0
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-24_10:08:25_CEST [openHABian] Applying file permissions recommendations... '
2021-10-24_10:08:25_CEST [openHABian] Applying file permissions recommendations... + openhab_is_installed
+ openhab2_is_installed
++ dpkg -s openhab2
++ grep Status
++ cut '-d ' -f2
+ [[ '' == \i\n\s\t\a\l\l ]]
+ return 1
+ openhab3_is_installed
++ dpkg -s openhab
++ grep Status
++ cut '-d ' -f2
+ [[ install == \i\n\s\t\a\l\l ]]
+ return 0
+ return 0
+ cond_echo 'Setting Java and arping file capabilites'
+ [[ -z '' ]]
+ echo -e '\033[33;01mSetting Java and arping file capabilites\033[39;49;00m'
Setting Java and arping file capabilites
+++ command -v java
++ realpath /usr/bin/java
+ cond_redirect setcap 'cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep' /opt/jdk/zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /opt/jdk/zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java \033[39;49;00m'

$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /opt/jdk/zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java
+ setcap 'cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep' /opt/jdk/zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java
+ return 0
+ cond_redirect setcap 'cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep' /usr/sbin/arping
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /usr/sbin/arping \033[39;49;00m'

$ setcap cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep /usr/sbin/arping
+ setcap 'cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep' /usr/sbin/arping
+ return 0
+ for pGroup in "${groups[@]}"
+ grep -qs '^[[:space:]]*audio:' /etc/group
+ cond_redirect usermod --append --groups audio openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups audio openhab \033[39;49;00m'

$ usermod --append --groups audio openhab
+ usermod --append --groups audio openhab
+ return 0
+ cond_redirect usermod --append --groups audio openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups audio openhabian \033[39;49;00m'

$ usermod --append --groups audio openhabian
+ usermod --append --groups audio openhabian
+ return 0
+ for pGroup in "${groups[@]}"
+ grep -qs '^[[:space:]]*bluetooth:' /etc/group
+ cond_redirect usermod --append --groups bluetooth openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups bluetooth openhab \033[39;49;00m'

$ usermod --append --groups bluetooth openhab
+ usermod --append --groups bluetooth openhab
+ return 0
+ cond_redirect usermod --append --groups bluetooth openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups bluetooth openhabian \033[39;49;00m'

$ usermod --append --groups bluetooth openhabian
+ usermod --append --groups bluetooth openhabian
+ return 0
+ for pGroup in "${groups[@]}"
+ grep -qs '^[[:space:]]*dialout:' /etc/group
+ cond_redirect usermod --append --groups dialout openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups dialout openhab \033[39;49;00m'

$ usermod --append --groups dialout openhab
+ usermod --append --groups dialout openhab
+ return 0
+ cond_redirect usermod --append --groups dialout openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups dialout openhabian \033[39;49;00m'

$ usermod --append --groups dialout openhabian
+ usermod --append --groups dialout openhabian
+ return 0
+ for pGroup in "${groups[@]}"
+ grep -qs '^[[:space:]]*gpio:' /etc/group
+ cond_redirect usermod --append --groups gpio openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups gpio openhab \033[39;49;00m'

$ usermod --append --groups gpio openhab
+ usermod --append --groups gpio openhab
+ return 0
+ cond_redirect usermod --append --groups gpio openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups gpio openhabian \033[39;49;00m'

$ usermod --append --groups gpio openhabian
+ usermod --append --groups gpio openhabian
+ return 0
+ for pGroup in "${groups[@]}"
+ grep -qs '^[[:space:]]*tty:' /etc/group
+ cond_redirect usermod --append --groups tty openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups tty openhab \033[39;49;00m'

$ usermod --append --groups tty openhab
+ usermod --append --groups tty openhab
+ return 0
+ cond_redirect usermod --append --groups tty openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups tty openhabian \033[39;49;00m'

$ usermod --append --groups tty openhabian
+ usermod --append --groups tty openhabian
+ return 0
+ cond_redirect usermod --append --groups openhab openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups openhab openhabian \033[39;49;00m'

$ usermod --append --groups openhab openhabian
+ usermod --append --groups openhab openhabian
+ return 0
+ cond_redirect chown --silent openhab:openhab /srv /opt
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chown --silent openhab:openhab /srv /opt \033[39;49;00m'

$ chown --silent openhab:openhab /srv /opt
+ chown --silent openhab:openhab /srv /opt
+ return 0
+ cond_redirect chmod --silent ugo+w /srv
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod --silent ugo+w /srv \033[39;49;00m'

$ chmod --silent ugo+w /srv
+ chmod --silent ugo+w /srv
+ return 0
+ cond_redirect chown --recursive openhab:openhab /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chown --recursive openhab:openhab /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab \033[39;49;00m'

$ chown --recursive openhab:openhab /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ chown --recursive openhab:openhab /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ return 0
+ cond_redirect chmod --recursive u+wX,g+wX /opt /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod --recursive u+wX,g+wX /opt /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab \033[39;49;00m'

$ chmod --recursive u+wX,g+wX /opt /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ chmod --recursive u+wX,g+wX /opt /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ return 0
+ [[ -d /var/lib/openhab/.ssh ]]
+ [[ -d /var/lib/openhab/backups ]]
+ cond_redirect chown openhab:openhab /var/lib/openhab/backups
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chown openhab:openhab /var/lib/openhab/backups \033[39;49;00m'

$ chown openhab:openhab /var/lib/openhab/backups
+ chown openhab:openhab /var/lib/openhab/backups
+ return 0
+ cond_redirect chmod g+s '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod g+s /var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab \033[39;49;00m'

$ chmod g+s /var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ chmod g+s '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab'
chmod: cannot access '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab': No such file or directory
+ return 1
+ echo 'FAILED (setgid backups folder)'
FAILED (setgid backups folder)
+ retval=1
+ cond_redirect fix_permissions /home/openhabian openhabian:openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /home/openhabian openhabian:openhabian \033[39;49;00m'

$ fix_permissions /home/openhabian openhabian:openhabian
+ fix_permissions /home/openhabian openhabian:openhabian
+ [[ -e /home/openhabian ]]
+ chown openhabian:openhabian /home/openhabian
+ [[ -n '' ]]
+ return 0
+ return 0
+ cond_redirect setfacl --recursive --remove-all /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ setfacl --recursive --remove-all /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab \033[39;49;00m'

$ setfacl --recursive --remove-all /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ setfacl --recursive --remove-all /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ return 0
+ cond_redirect fix_permissions /var/log/unattended-upgrades root:root 644 755
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /var/log/unattended-upgrades root:root 644 755 \033[39;49;00m'

$ fix_permissions /var/log/unattended-upgrades root:root 644 755
+ fix_permissions /var/log/unattended-upgrades root:root 644 755
+ [[ -e /var/log/unattended-upgrades ]]
+ chown root:root /var/log/unattended-upgrades
+ [[ -n 644 ]]
+ [[ -f /var/log/unattended-upgrades ]]
+ [[ -n 755 ]]
+ [[ -d /var/log/unattended-upgrades ]]
+ find /var/log/unattended-upgrades -type d -print0
+ xargs -0 chmod 755
+ return 0
+ return 0
+ cond_redirect fix_permissions /var/log/samba root:root 640 750
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /var/log/samba root:root 640 750 \033[39;49;00m'

$ fix_permissions /var/log/samba root:root 640 750
+ fix_permissions /var/log/samba root:root 640 750
+ [[ -e /var/log/samba ]]
+ chown root:root /var/log/samba
+ [[ -n 640 ]]
+ [[ -f /var/log/samba ]]
+ [[ -n 750 ]]
+ [[ -d /var/log/samba ]]
+ find /var/log/samba -type d -print0
+ xargs -0 chmod 750
+ return 0
+ return 0
+ cond_redirect fix_permissions /var/log/openhab openhab:openhabian 664 775
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /var/log/openhab openhab:openhabian 664 775 \033[39;49;00m'

$ fix_permissions /var/log/openhab openhab:openhabian 664 775
+ fix_permissions /var/log/openhab openhab:openhabian 664 775
+ [[ -e /var/log/openhab ]]
+ chown openhab:openhabian /var/log/openhab
+ [[ -n 664 ]]
+ [[ -f /var/log/openhab ]]
+ [[ -n 775 ]]
+ [[ -d /var/log/openhab ]]
+ find /var/log/openhab -type d -print0
+ xargs -0 chmod 775
+ return 0
+ return 0
+ mosquitto_is_installed
+ dpkg -s mosquitto mosquitto-clients
+ return 0
+ cond_redirect fix_permissions /etc/mosquitto/passwd mosquitto:openhabian 640 750
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /etc/mosquitto/passwd mosquitto:openhabian 640 750 \033[39;49;00m'

$ fix_permissions /etc/mosquitto/passwd mosquitto:openhabian 640 750
+ fix_permissions /etc/mosquitto/passwd mosquitto:openhabian 640 750
+ [[ -e /etc/mosquitto/passwd ]]
+ return 0
+ return 0
+ cond_redirect fix_permissions /var/log/mosquitto mosquitto:openhabian 644 755
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /var/log/mosquitto mosquitto:openhabian 644 755 \033[39;49;00m'

$ fix_permissions /var/log/mosquitto mosquitto:openhabian 644 755
+ fix_permissions /var/log/mosquitto mosquitto:openhabian 644 755
+ [[ -e /var/log/mosquitto ]]
+ chown mosquitto:openhabian /var/log/mosquitto
+ [[ -n 644 ]]
+ [[ -f /var/log/mosquitto ]]
+ [[ -n 755 ]]
+ [[ -d /var/log/mosquitto ]]
+ find /var/log/mosquitto -type d -print0
+ xargs -0 chmod 755
+ return 0
+ return 0
+ influxdb_is_installed
+ dpkg -s influxdb
+ return 1
+ zram_is_installed
+ [[ -s /etc/ztab ]]
+ [[ -d /opt/zram ]]
+ return 0
+ influxdb_is_installed
+ dpkg -s influxdb
+ return 1
+ grafana_is_installed
+ dpkg -s grafana
+ return 1
+ mosquitto_is_installed
+ dpkg -s mosquitto mosquitto-clients
+ return 0
+ cond_redirect fix_permissions /opt/zram/log.bind/mosquitto mosquitto:openhabian 644 755
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /opt/zram/log.bind/mosquitto mosquitto:openhabian 644 755 \033[39;49;00m'

$ fix_permissions /opt/zram/log.bind/mosquitto mosquitto:openhabian 644 755
+ fix_permissions /opt/zram/log.bind/mosquitto mosquitto:openhabian 644 755
+ [[ -e /opt/zram/log.bind/mosquitto ]]
+ chown mosquitto:openhabian /opt/zram/log.bind/mosquitto
+ [[ -n 644 ]]
+ [[ -f /opt/zram/log.bind/mosquitto ]]
+ [[ -n 755 ]]
+ [[ -d /opt/zram/log.bind/mosquitto ]]
+ find /opt/zram/log.bind/mosquitto -type d -print0
+ xargs -0 chmod 755
+ return 0
+ return 0
+ cond_redirect fix_permissions /opt/zram/log.bind/samba root:root 640 750
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /opt/zram/log.bind/samba root:root 640 750 \033[39;49;00m'

$ fix_permissions /opt/zram/log.bind/samba root:root 640 750
+ fix_permissions /opt/zram/log.bind/samba root:root 640 750
+ [[ -e /opt/zram/log.bind/samba ]]
+ chown root:root /opt/zram/log.bind/samba
+ [[ -n 640 ]]
+ [[ -f /opt/zram/log.bind/samba ]]
+ [[ -n 750 ]]
+ [[ -d /opt/zram/log.bind/samba ]]
+ find /opt/zram/log.bind/samba -type d -print0
+ xargs -0 chmod 750
+ return 0
+ return 0
+ cond_redirect fix_permissions /opt/zram/log.bind/openhab openhab:openhabian 664 775
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /opt/zram/log.bind/openhab openhab:openhabian 664 775 \033[39;49;00m'

$ fix_permissions /opt/zram/log.bind/openhab openhab:openhabian 664 775
+ fix_permissions /opt/zram/log.bind/openhab openhab:openhabian 664 775
+ [[ -e /opt/zram/log.bind/openhab ]]
+ chown openhab:openhabian /opt/zram/log.bind/openhab
+ [[ -n 664 ]]
+ [[ -f /opt/zram/log.bind/openhab ]]
+ [[ -n 775 ]]
+ [[ -d /opt/zram/log.bind/openhab ]]
+ find /opt/zram/log.bind/openhab -type d -print0
+ xargs -0 chmod 775
+ return 0
+ return 0
+ cond_redirect fix_permissions /opt/zram/persistence.bind openhab:openhabian 664 775
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ fix_permissions /opt/zram/persistence.bind openhab:openhabian 664 775 \033[39;49;00m'

$ fix_permissions /opt/zram/persistence.bind openhab:openhabian 664 775
+ fix_permissions /opt/zram/persistence.bind openhab:openhabian 664 775
+ [[ -e /opt/zram/persistence.bind ]]
+ chown openhab:openhabian /opt/zram/persistence.bind
+ [[ -n 664 ]]
+ [[ -f /opt/zram/persistence.bind ]]
+ [[ -n 775 ]]
+ [[ -d /opt/zram/persistence.bind ]]
+ find /opt/zram/persistence.bind -type d -print0
+ xargs -0 chmod 775
+ return 0
+ return 0
+ echo OK
OK
+ homegear_is_installed
+ dpkg -s homegear
+ return 1
+ [[ -d /opt/habapp ]]
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "10 | Apply Improvements"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
+ true

The command that gives an error is

+ cond_redirect chmod g+s '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod g+s /var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab \033[39;49;00m'

$ chmod g+s /var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab
+ chmod g+s '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab'
chmod: cannot access '/var/lib/openhab/backups /etc/openhab /var/lib/openhab /var/log/openhab /usr/share/openhab': No such file or directory
+ return 1
+ echo 'FAILED (setgid backups folder)'
FAILED (setgid backups folder)
+ retval=1

but if I give the same command from the prompt (preceding it with sudo) it does not fail.

Is this a bug?

I investigated a little deeper and found that the problem of mosquitto not starting in the attempt done from fresh install was related to the \var\log\mosquitto directory. For some reason, it was not present in the mirror and that was caausing the problem. Strangely enough, the debug script was not complaining that the directory was not present. Once I created that directory and re-run the fix_permission options, the mosquitto service started. My explanation is that the mirror was taken at install time, when mosquitto was not installed and the option SD Sync does not actually synchronize the /var/log/mosquitto directory.

The missing /var/log/mosquitto problem did not explain what happend to my production system, though, because I verified that such a directory was indeed present in the mirror SD. Before shutting-down my production system, in order to try again to boot with the backup sd, I stopped zram,openhab, habapp and, differently from all the previous attempts, also mosquitto. The backup sd card booted and mosquitto did not fail. Finally the fix permission option 14 always give the error but it does not stop at the prompt anymore as it happened repeatedly this morning.

Next step will be to burn a 16Gb SD card

I’m having quite some trouble to setup openhabian with clonebranch=stable. No successfull installation possible on my rpi4 4GB
See my post here, if interested.

1 Like

After installing a brand new 1.7.1 using clonebranch=main, i realized i had to change my hostname (oh-test should have been a clonebranch=stable environmet, which is not possible to install atm - and i forgot to change). So i ran openhabian-config and changed the hostname to oh3-test, did a reboot and logged in. This resulted in the following output:

Using username "marino".
Linux oh3-test 5.10.63-v7l+ #1488 SMP Thu Nov 18 16:15:28 GMT 2021 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Dec  4 21:00:30 2021 from 172.16.172.51

###############################################################################
###############  oh-test  #####################################################
###############################################################################
##        Ip = 172.16.172.63
##   Release = Raspbian GNU/Linux 11 (bullseye)
##    Kernel = Linux 5.10.63-v7l+
##  Platform = Raspberry Pi 4 Model B Rev 1.2
##    Uptime = 0 day(s). 0:16:49
## CPU Usage = 0.25% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 0.00, 5m: 0.01, 15m: 0.02
##    Memory = Free: 3.21GB (85%), Used: 0.57GB (15%), Total: 3.79GB
##      Swap = Free: 2.43GB (100%), Used: 0.00GB (0%), Total: 2.43GB
##      Root = Free: 8.70GB (65%), Used: 4.61GB (35%), Total: 13.92GB
##   Updates = 0 apt updates available.
##  Sessions = 1 session(s)
## Processes = 125 running processes of 32768 maximum processes
###############################################################################

                          _   _     _     ____   _
  ___   ___   ___   ___  | | | |   / \   | __ ) (_)  ____   ___
 / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ | | / _  \ / _ \
| (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )| || (_) || | | |
 \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ |_| \__|_||_| | |
      |_|                          3.1.0 - Release Build

Looking for a place to get started? Check out 'sudo openhabian-config' and the
documentation at https://www.openhab.org/docs/installation/openhabian.html
The openHAB dashboard can be reached at http://oh3-test:8080
To interact with openHAB on the command line, execute: 'openhab-cli --help'

marino@oh3-test:~ $
marino@oh3-test:~ $ hostname
oh3-test
marino@oh3-test:~ $

I don’t know, where the text generated at login time gets its information from.

same to me… but I don’t care.
The information comes from a tool called firemotd
maybe it pulls out some information from /etc/openhabian.conf

just found out: reason is FireMotD reading from cache. I ran

sudo FireMotD -G Gray

and got the correct hostname. Used theme “Gray” may be found in ~/.bash_profile.

Might be a good idea to integrate this in openhabian-config → 31.

EDIT means: german languguage sentence was a leftover from checking with google translator. ^^
Sorry.

While trying to understand the inconsistency with the hostname on the login screen (see above), I looked at the text a few times of course.

In the end i noticed the following:

                          _   _     _     ____   _
  ___   ___   ___   ___  | | | |   / \   | __ ) (_)  ____   ___
 / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ | | / _  \ / _ \
| (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )| || (_) || | | |
 \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ |_| \__|_||_| | |
      |_|                          3.1.0 - Release Build

which - for me - seems to be definitely wrong. The maintainer and others try to educate all users to understand that openhain and openhab separate things (not to be confused with an openHAB thing).

Yes boys (there aren’t any girls, no?): i got that. I am running openhabian 1.7.1 which installed an openhab 3.1 as requested.
I believe it is more than a good idea to get that cleaned up before telling more people something like “There is no openHABian 3.1.0. Release Build”.

Have fun!

Yes, that’s total nonsense :rofl: