Re: Umzug OH auf Linux
Verfasst: 25. Sep 2021 22:19
Der Keyring ist für Zulu Java, das ist direkt bei azul beschrieben: https://docs.azul.com/core/zulu-openjdk/install/debian
Also mein openhabian.conf sieht wie folgt aus und hat nur 3 Unterschiede, welche aber (aus meiner Sicht) nicht die immer noch auftretenden Fehler verursachen sollten.
Code: Alles auswählen
# 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=openhabian2
# 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=amd64
# OS distribution/release
# Valid arguments: raspios, raspbian, debian, ubuntu, stretch, buster, bionic, focal
osrelease=debian
# Java architecture mode
# Valid arguments: "Adopt11", "Zulu11-32", or "Zulu11-64"
java_opt=Zulu11-64
# openHAB Log Viewer (frontail) theme
# Valid arguments: "light", "dark"
frontailtheme=light
# install zram per default, set to "disable" to skip installation
zraminstall=disable
# 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
Code: Alles auswählen
hostname=openhabian2
username=openhabian
userpw=openhabian
adminkeyurl=""
timezone=Europe/Berlin
locales="en_US.UTF-8 de_DE.UTF-8"
system_default_locale="en_US.UTF-8"
wifi_ssid=""
wifi_password=""
wifi_country=""
ipv6=enable
repositoryurl=https://github.com/openhab/openhabian.git
clonebranch=openHAB3 <<== Unterschied 1
debugmode=off
hwarch=amd64
osrelease=debian
java_opt=Zulu11-64
frontailtheme=light <<== Unterschied 2
zraminstall=disable
hotspot=enable <<== Unterschied 3
storageconfig=openhab-dir
storagedir=/storage
storagetapes=15
storagecapacity=1024
Code: Alles auswählen
int5749@Debian:~$ sudo bash
[sudo] Passwort für int5749:
root@Debian:/home/int5749# openhabian-config unattended
2021-09-25_22:49:58_CEST [openHABian] Checking for root privileges... OK
2021-09-25_22:49:58_CEST [openHABian] Updating Linux package information... OK
2021-09-25_22:50:00_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2021-09-25_22:50:00_CEST [openHABian] Adjusting swap size to 8192 MB... FAILED (swapoff)
2021-09-25_22:50:00_CEST [openHABian] Setting timezone based on openhabian.conf... OK (Europe/Berlin)
2021-09-25_22:50:00_CEST [openHABian] Enabling time synchronization using NTP... SKIPPED
2021-09-25_22:50:01_CEST [openHABian] Setting locale based on openhabian.conf... OK (reboot required)
2021-09-25_22:50:12_CEST [openHABian] Setting hostname of the base system based on openhabian.conf... OK
2021-09-25_22:50:12_CEST [openHABian] Setting the GPU memory split down to 16MB for headless system... OK
2021-09-25_22:50:12_CEST [openHABian] Enabling Audio output... OK
2021-09-25_22:50:12_CEST [openHABian] Installing basic can't-be-wrong packages (screen, vim, ...)... OK
2021-09-25_22:50:45_CEST [openHABian] Installing additional needed packages... OK
2021-09-25_22:51:34_CEST [openHABian] Installing pigpio package... FAILED
2021-09-25_22:51:34_CEST [openHABian] Adding slightly tuned bash configuration files to system... OK
2021-09-25_22:51:34_CEST [openHABian] Adding slightly tuned vim configuration file to system... OK
2021-09-25_22:51:35_CEST [openHABian] Downloading FireMotD... OK
2021-09-25_22:51:38_CEST [openHABian] Installing FireMotD... OK
2021-09-25_22:51:38_CEST [openHABian] Generating FireMotD theme... OK
2021-09-25_22:51:52_CEST [openHABian] Setting up FireMotD apt updates count service... FAILED (service enable)
2021-09-25_22:51:53_CEST [openHABian] Adding required keys to apt... OK
2021-09-25_22:51:55_CEST [openHABian] Adding Zulu repository to apt... OK
2021-09-25_22:51:57_CEST [openHABian] Installing Zulu 11 Enterprise 64-Bit OpenJDK... OK
2021-09-25_22:52:41_CEST [openHABian] Installing Java Zulu CEK to enable unlimited cipher strength... OK
2021-09-25_22:52:41_CEST [openHABian] Beginning install of latest openHAB3 release (stable)... OK
2021-09-25_22:52:41_CEST [openHABian] Adding required keys to apt... FAILED
2021-09-25_22:52:42_CEST [openHABian] Adding openHAB syntax to vim editor... OK
2021-09-25_22:52:43_CEST [openHABian] Adding openHAB syntax to nano editor... OK
2021-09-25_22:52:43_CEST [openHABian] Adding openHAB scheme to multitail... OK
2021-09-25_22:52:43_CEST [openHABian] Preparing openHAB folder mounts under '/srv/openhab-*'... OK
2021-09-25_22:52:46_CEST [openHABian] Applying miscellaneous system settings... OK
2021-09-25_22:52:46_CEST [openHABian] Installing Samba... OK
2021-09-25_22:53:11_CEST [openHABian] Setting up Samba network shares... OK
2021-09-25_22:53:11_CEST [openHABian] Setting up Samba service... OK
2021-09-25_22:53:12_CEST [openHABian] Applying file permissions recommendations... FAILED (please execute after openHAB is installed)
2021-09-25_22:53:12_CEST [openHABian] Installing Frontail prerequsites (NodeJS)... OK
FAILED (adduser)
/usr/local/bin/openhabian-config: Zeile 116: custom_log: Kommando nicht gefunden.
2021-09-25_22:53:29_CEST [openHABian] Skipping zram install as requested.2021-09-25_22:53:29_CEST [openHABian] Installing MTA required packages (mailutils, exim4, dnsutils)... OK
OK
2021-09-25_22:53:44_CEST [openHABian] Beginning Mail Transfer Agent setup... OK
2021-09-25_22:53:44_CEST [openHABian] Creating MTA config... OK
2021-09-25_22:53:44_CEST [openHABian] Adding to john.doe@foo.bar email to system accounts... OK
2021-09-25_22:53:44_CEST [openHABian] tailscale VPN installation... SKIPPED (no preauthkey defined)
2021-09-25_22:53:44_CEST [openHABian] Setting up automated SD mirroring and backup... OK
blockdev: cannot open /dev/sda: Datei oder Verzeichnis nicht gefunden
FAILED (bad destination)
2021-09-25_22:53:46_CEST [openHABian] Cleaning up... OK
Eigentlich nur Standard durch-geklickert, jedoch war im Vergleich zu dem laufenden openHABian LXC die Option Nesting eingeschaltet. Dies brauchte ich für einen Docker LXC und hat er dann wahrscheinlich als default für weiter Container gesetzt. Aber auch ohne die Option laufe ich in das gleiche Problem (gerade getestet)
Code: Alles auswählen
apt update && apt -y full-upgrade && apt -y install git gnupg htop sudo
Code: Alles auswählen
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
Code: Alles auswählen
git clone -b openHAB3 https://github.com/openhab/openhabian.git /opt/openhabian
ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config
cp /opt/openhabian/build-image/openhabian.conf /etc/openhabian.conf
nano /etc/openhabian.conf
Code: Alles auswählen
system_default_locale="de_DE.UTF-8" <--- wir wollen deutsches Layout
hwarch=amd64 <--- die Architektur des LXC Containers
osrelease=bullseye <--- Das Betriebssystem
java_opt=11 <--- erlaubt ist nur 11 oder 17 (Ergänzung 14.3.23)
zraminstall=disable <--- Wir nutzen kein zram
hotspot=disable <--- Wir haben kein WLAN
Code: Alles auswählen
openhabian-config unattended
Code: Alles auswählen
FireMotD --theme digipolis
Ja, ich war auch schon dabei eine Zusammenfassung zu schreiben, aber da warst Du schneller
Code: Alles auswählen
sudo bash
Code: Alles auswählen
FireMotD -t Digipolis
Code: Alles auswählen
.bashrc
Code: Alles auswählen
sudo nano ~/.bashrc
Dies kommt, da die Themes noch nicht aufgebaut sind und der "normale" User dort keine Rechte hat/usr/local/bin/FireMotD: line 1585: /usr/share/firemotd/cache/firemotd-Digipolis.motd: Permission denied
Code: Alles auswählen
sudo FireMotD -G all
Code: Alles auswählen
openhab-cli backup
Code: Alles auswählen
Using '/etc/openhab' as conf folder...
Using '/var/lib/openhab' as userdata folder...
Using '/usr/share/openhab/runtime' as runtime folder...
Using '/var/lib/openhab/backups' as backup folder...
Writing to '/var/lib/openhab/backups/openhab-backup-21_09_27-20_15_54.zip'...
Making Temporary Directory if it is not already there
Using /tmp/openhab/backup as TempDir
#########################################
openHAB backup script
#########################################
Copying configuration to temporary folder...
cp: der Aufruf von stat für '/var/lib/openhab/C:openHABuserdata' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
cp: der Aufruf von stat für '/var/lib/openhab/D:OpenHABuserdata' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
Removing unnecessary files...
Zipping folder...
Removing temporary files...
Success! Backup made in /var/lib/openhab/backups/openhab-backup-21_09_27-20_15_54.zip
Code: Alles auswählen
##########################################
openHAB restore script
##########################################
Using '/etc/openhab' as conf folder...
Using '/var/lib/openhab' as userdata folder...
Making Temporary Directory
Extracting zip file to temporary folder.
Backup Information:
-------------------
(You are on 3.1.0) | 3.1.0
Backup Timestamp | 21_09_23-19_44_54
Config belongs to user | openhab
from group | openhab
Your current configuration will become owned by openhab:openhab.
Any existing files with the same name will be replaced.
Any file without a replacement will be deleted.
Okay to Continue? [y/N]: y
Moving system files in userdata to temporary folder
Deleting old userdata folder...
Restoring system files in userdata...
Deleting old conf folder...
Restoring openHAB with backup configuration...
Deleting temporary files...
Backup successfully restored!
Code: Alles auswählen
openhab-cli backup
Using '/etc/openhab' as conf folder...
Using '/var/lib/openhab' as userdata folder...
Using '/usr/share/openhab/runtime' as runtime folder...
Using '/var/lib/openhab/backups' as backup folder...
Writing to '/var/lib/openhab/backups/openhab-backup-21_09_27-22_50_36.zip'...
Making Temporary Directory if it is not already there
Using /tmp/openhab/backup as TempDir
#########################################
openHAB backup script
#########################################
Copying configuration to temporary folder...
Removing unnecessary files...
Zipping folder...
Removing temporary files...
Success! Backup made in /var/lib/openhab/backups/openhab-backup-21_09_27-22_50_36.zip