software:controller:vzlogger:installation_en
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| software:controller:vzlogger:installation_en [2018/04/01 15:30] – Titel jau | software:controller:vzlogger:installation_en [2023/03/13 07:57] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 4: | Zeile 4: | ||
| Our repository: https:// | Our repository: https:// | ||
| - | Actually vzlogger and some of the libraries are only provided by sourcecode. They have to be compiled before use. | + | Actually vzlogger and sometimes |
| Select a working directory your user has writing permissions. For example the home directory: | Select a working directory your user has writing permissions. For example the home directory: | ||
| < | < | ||
| cd ~ | cd ~ | ||
| </ | </ | ||
| + | The most experience is collected from Debian and other Distributions close (Ubuntu, Raspian). The following guide is based on Debian " | ||
| ===== Prerequisites for compiling vzlogger ===== | ===== Prerequisites for compiling vzlogger ===== | ||
| Zeile 15: | Zeile 16: | ||
| === Tools === | === Tools === | ||
| - | * git (package: git-core) | + | * git |
| * cmake | * cmake | ||
| * pkg-config | * pkg-config | ||
| Zeile 31: | Zeile 32: | ||
| * libltdl >=0.8.0 (for OMS) | * libltdl >=0.8.0 (for OMS) | ||
| * libleptonica-dev (for OCR) | * libleptonica-dev (for OCR) | ||
| + | * libmosquitto-dev (for MQTT) | ||
| + | * libunistring-dev (due to problem Ubuntu 18.04) | ||
| === Debian packages === | === Debian packages === | ||
| - | On Debian-Jessie | + | On Debian based distributions, most of these dependencies can easily be installed with: |
| (as root, consider running " | (as root, consider running " | ||
| - | < | + | < |
| - | + | ||
| - | For Debian Wheezy: | + | |
| - | < | + | |
| ===== Build by script ===== | ===== Build by script ===== | ||
| Zeile 64: | Zeile 63: | ||
| </ | </ | ||
| - | ===== Build by hand ===== | + | The based SML Library may (before) updated by: |
| - | In cases the script does not fit the conditions. | + | |
| - | + | ||
| - | === Building libjson === | + | |
| - | + | ||
| - | The best case is building libjson from source, which is simple too: | + | |
| < | < | ||
| - | sudo apt-get install dh-autoreconf | + | cd vzlogger/ |
| - | git clone -b json-c-0.12 https:// | + | git pull |
| - | cd json-c | + | cd ../.. |
| - | sh autogen.sh | + | ./install.sh libsml |
| - | ./configure | + | |
| - | make | + | |
| - | sudo make install | + | |
| </ | </ | ||
| - | Go back to your starting directory: | + | ===== Build by hand ===== |
| + | In cases the script does not fit the conditions. | ||
| + | <note warning>Only for experienced users! Follow [[/ | ||
| === Building libsml === | === Building libsml === | ||
| + | Debian provides a paket libsml-dev, but it's not well maintained and too old for our needs. | ||
| < | < | ||
| git clone https:// | git clone https:// | ||
| Zeile 106: | Zeile 100: | ||
| mkdir build | mkdir build | ||
| cd build | cd build | ||
| - | cmake .. | + | cmake -DBUILD_TEST=off |
| make | make | ||
| sudo make install | sudo make install | ||
| </ | </ | ||
| - | if you are having trouble building with libsml, instead of just " | + | Go back to your starting directory: < |
| + | |||
| + | == Build as Debian-paket == | ||
| + | The vzlogger repository contains code to build a "clean" paket for Debian. | ||
| < | < | ||
| - | cmake .. -DSML_HOME=/path/to/libsml | + | git clone https:// |
| + | cd vzlogger | ||
| + | apt build-dep ./ | ||
| + | apt install devscripts | ||
| + | debuild | ||
| </ | </ | ||
| - | |||
| - | Go back to your starting directory: < | ||
| === Building OMS === | === Building OMS === | ||
| Zeile 137: | Zeile 136: | ||
| If a update is necessary follow these steps: | If a update is necessary follow these steps: | ||
| < | < | ||
| - | sudo systemctl stop vzlogger | ||
| cd vzlogger | cd vzlogger | ||
| git pull | git pull | ||
| cd build | cd build | ||
| - | cmake .. | + | cmake -DBUILD_TEST=off .. |
| make | make | ||
| + | sudo systemctl stop vzlogger | ||
| sudo make install | sudo make install | ||
| - | cd ../.. | ||
| sudo systemctl start vzlogger | sudo systemctl start vzlogger | ||
| </ | </ | ||
| ====== Systemd start script ====== | ====== Systemd start script ====== | ||
| + | Systemd is used to install and execute services in background (daemon). | ||
| - | The installscript asks you for installing the systemd unit file for you. If your computer uses systemd (Debian-Jessie) you may answer yes. | + | The installscript asks you for installing the systemd unit file for you. If your computer uses systemd (since Debian-Jessie) you may answer yes. |
| If you want to copy and edit it by yourself you find a template under: [[https:// | If you want to copy and edit it by yourself you find a template under: [[https:// | ||
| Zeile 173: | Zeile 172: | ||
| sudo systemctl enable vzlogger | sudo systemctl enable vzlogger | ||
| </ | </ | ||
| + | |||
| + | ====== Run vzlogger with different user ====== | ||
| + | |||
| + | === Elevated privileges for vzlogger binary === | ||
| + | |||
| + | < | ||
| + | sudo setcap ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | === Add Daemon-User === | ||
| + | |||
| + | Add a user without home-directory and generate password. | ||
| + | < | ||
| + | sudo useradd -M vzlogger | ||
| + | sudo passwd vzlogger | ||
| + | </ | ||
| + | |||
| + | Add the user to the follwing groups: | ||
| + | < | ||
| + | sudo usermod -aG gpio vzlogger | ||
| + | sudo usermod -aG dialout vzlogger | ||
| + | sudo usermod -aG staff vzlogger | ||
| + | </ | ||
| + | |||
| + | For the logfile generate a sub-directory with adequate rights. | ||
| + | < | ||
| + | sudo mkdir / | ||
| + | sudo chgrp staff / | ||
| + | sudo chmod g+w / | ||
| + | </ | ||
| + | |||
| + | === adapt vzlogger.conf === | ||
| + | |||
| + | The new location oft logfile has to be configured accordingly. ''/ | ||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | |||
| + | === adapt Systemd startscript === | ||
| + | |||
| + | Last change is to promote the new user in systemd startscript (see chapter above). | ||
| + | |||
| + | Under [Service] add the following line: | ||
| + | < | ||
| + | User=vzlogger | ||
| + | </ | ||
| + | |||
| + | Systemd need to be restartet to activate the change: | ||
| + | |||
| + | < | ||
| + | sudo systemctl daemon-reload | ||
| + | </ | ||
| + | |||
| + | === Use-sase=== | ||
| + | |||
| + | This adaption is of particular interest in combination with meter-protocol " | ||
| ====== Special hints ====== | ====== Special hints ====== | ||
software/controller/vzlogger/installation_en.1522589441.txt.gz · Zuletzt geändert: von jau