Re: HILFE!!!
Verfasst: 8. Jul 2021 07:43
Komme nicht weiter...bin halt ein Anfänger!
Hab es korrigiert, damit Nachlesende nicht drüber stolpern.udo1toni hat geschrieben: ↑7. Jul 2021 16:05 Ja, da fehlt ein Slash… Der Befehl heißt
Die Datei muss schon existieren, mit dem angegebenen Inhalt (also mindestens… da kann noch mehr drin stehen…)Code: Alles auswählen
sudo nano /etc/default/openhab2
sudo sorgt dafür, dass Du Schreibrechte hast.
nano ist der Editor.
/etc/default/ ist der Pfad zur Datei und
openhab2 ist der Dateiname.
Handelt es sich um openHAB3, so heißt die Datei nur noch openhab, da soll einer noch durchblicken…
Die Datei enthält die Default Konfiguration für verschiedene Parameter, die mit dem Start von openHAB zusammenhängen, also z.B. die Ports, auf denen der Webserver lauscht, der User, unter dem das Programm gestartet wird, zusätzliche Optionen, die beim Programmstart mit übergeben werden (z.B. für mehr Speicher, zusätzliche Hardware, …) und so weiter.
Dabei sind die Parameter alle aus kommentiert, werden also ignoriert. Stattdessen werden die Standard Parameter verwendet, wie sie im Programm selbst hinterlegt sind.
Wenn Du also einen Parameter ändern willst, musst Du den Parameter anpassen und die Raute entfernen.
Allgemein kopiert man die Zeile und führt die Änderungen an der kopierten Zeile durch, dann hat man weiterhin die Information über den Default Wert.
Gesendet von iPad mit Tapatalk
Code: Alles auswählen
sudo nano /etc/default/openhab2
Code: Alles auswählen
sudo nano /etc/default/openhab
Code: Alles auswählen
#########################
...
## PORTS
## The ports openHAB will bind its HTTP/HTTPS web server to.
#OPENHAB_HTTP_PORT=8080
#OPENHAB_HTTPS_PORT=8443
...
Code: Alles auswählen
#########################
## PORTS
## The ports openHAB will bind its HTTP/HTTPS web server to.
OPENHAB_HTTP_PORT=8181
#OPENHAB_HTTPS_PORT=8443
Code: Alles auswählen
#OPENHAB_HTTP_PORT=8181
Code: Alles auswählen
OPENHAB_HTTP_PORT=8181
Code: Alles auswählen
#########################
...
## PORTS
## The ports openHAB will bind its HTTP/HTTPS web server to.
#OPENHAB_HTTP_PORT=8080
#OPENHAB_HTTPS_PORT=8443
OPENHAB_HTTP_PORT=8181
...
Code: Alles auswählen
sudo systemctl stop openhab2.service
sudo rm -rf /var/lib/openhab2/tmp/*
sudo rm -rf /var/lib/openhab2/cache/*
sudo systemctl start openhab2.service
Code: Alles auswählen
sudo rm -rf /var/lib/openhab2/tmp/*
sudo rm -rf /var/lib/openhab2/cache/*
Code: Alles auswählen
openhab-cli stop
openhab-cli clean-cache
openhab-cli start
Code: Alles auswählen
cat /etc/default/openhab2
# openHAB 2 service options
#########################
## PORTS
## The ports openHAB will bind its HTTP/HTTPS web server to.
#OPENHAB_HTTP_PORT=8080
#OPENHAB_HTTPS_PORT=8443
#########################
## HTTP(S) LISTEN ADDRESS
## The listen address used by the HTTP(S) server.
## 0.0.0.0 (default) allows a connection from any location
## 127.0.0.1 only allows the local machine to connect
#OPENHAB_HTTP_ADDRESS=0.0.0.0
#########################
## BACKUP DIRECTORY
## Set the following variable to specify the backup location.
## runtime/bin/backup and runtime/bin/restore will use this path for the zip files.
#OPENHAB_BACKUPS=/var/lib/openhab2/backups
#########################
## JAVA OPTIONS
## Additional options for the JAVA_OPTS environment variable.
## These will be appended to the execution of the openHAB Java runtime in front of all other options.
##
## A couple of independent examples:
## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"
## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"
## EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=Europe/Berlin -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0"
EXTRA_JAVA_OPTS="-Xms1024m -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Xbootclasspath/a:/etc/openhab2/automation/jython/jython-standalone-2.7.0.jar -Dpython.home=/etc/openhab2/automation/jython -Dpython.path=/usr/lib/python2.7/dist-packages:/etc/openhab2/automation/lib/python:$PYTHONPATH"
#########################
## OPENHAB DEFAULTS PATHS
## The following settings override the default apt/rpm locations and should be used with caution.
## openHAB will fail to update itself if you're using different paths.
## Only set these if you are testing and are confident in debugging.
#OPENHAB_HOME=/usr/share/openhab2
#OPENHAB_CONF=/etc/openhab2
#OPENHAB_RUNTIME=/usr/share/openhab2/runtime
#OPENHAB_USERDATA=/var/lib/openhab2
#OPENHAB_LOGDIR=/var/log/openhab2
#########################
## OPENHAB USER AND GROUP
## The user and group that takes ownership of openHAB. Only available for init.d systems.
## To edit user and group for systemd, see the service file at /usr/lib/systemd/system/openhab2.service.
#OPENHAB_USER=openhab
#OPENHAB_GROUP=openhab
#########################
## SYSTEMD START MODE
## The Karaf startmode for the openHAB runtime. Only available for systemctl/systemd systems.
## Defaults to daemon when unset here. Multiple options can be used without quotes.
## debug increases log output. daemon launches the Karaf/openHAB processes.
#OPENHAB_STARTMODE=debug
Code: Alles auswählen
sudo nano etc/default/openhab2
Code: Alles auswählen
sudo nano /etc/default/openhab2
Code: Alles auswählen
sudo systemctl status openhab2.service
Code: Alles auswählen
cat /etc/default/openhab2
Code: Alles auswählen
sudo netstat -tulpen | grep -v '127.0.0.1' | grep -v '::1:'
Code: Alles auswählen
sudo apt install net-tools
Code: Alles auswählen
sudo apt purge openhab2
Code: Alles auswählen
sudo apt install openhab2
Code: Alles auswählen
sudo systemctl stop openhab2.service
Code: Alles auswählen
sudo nano /etc/default/openhab2
Code: Alles auswählen
#OPENHAB_HTTP_PORT=8080
Code: Alles auswählen
OPENHAB_HTTP_PORT=8181
Code: Alles auswählen
sudo systemctl start openhab2.service
Code: Alles auswählen
http://ip.des.pi.servers:8181/
Code: Alles auswählen
systemctl status openhab2.service
Code: Alles auswählen
\/\/
openhab2.service - openHAB2 instance, reachable at http://openhab2:8181
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
/\/\/\