software:controller:vzlogger:installation_en
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| software:controller:vzlogger:installation_en [2017/03/22 03:55] – von /software/controller/vzlogger/installation_cpp-version verschoben jau | software:controller:vzlogger:installation_en [2023/03/13 07:57] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== vzlogger Installation ====== | + | ====== vzlogger Installation |
| === Repository === | === Repository === | ||
| 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 50: | Zeile 49: | ||
| The script supports also build of one single module. See the comments in the script for details. | The script supports also build of one single module. See the comments in the script for details. | ||
| + | |||
| + | === Daemon === | ||
| + | At this point a daemon-service should be prepared to run vzlogger in backgroung. Details [[/ | ||
| === Update === | === Update === | ||
| + | If a update is necessary follow these steps: | ||
| < | < | ||
| - | sudo systemctl stop vzlogger | + | sudo systemctl stop vzlogger |
| cd vzlogger | cd vzlogger | ||
| git pull | git pull | ||
| ./ | ./ | ||
| - | sudo systemctl start vzlogger | + | sudo systemctl start vzlogger |
| </ | </ | ||
| - | ===== 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 102: | Zeile 100: | ||
| mkdir build | mkdir build | ||
| cd build | cd build | ||
| - | cmake .. | + | cmake -DBUILD_TEST=off |
| make | make | ||
| sudo make install | sudo make install | ||
| Zeile 108: | Zeile 106: | ||
| Go back to your starting directory: < | Go back to your starting directory: < | ||
| + | |||
| + | == Build as Debian-paket == | ||
| + | The vzlogger repository contains code to build a " | ||
| + | < | ||
| + | git clone https:// | ||
| + | cd vzlogger | ||
| + | apt build-dep ./ | ||
| + | apt install devscripts | ||
| + | debuild | ||
| + | </ | ||
| === Building OMS === | === Building OMS === | ||
| Zeile 122: | Zeile 130: | ||
| Go back to your starting directory: < | Go back to your starting directory: < | ||
| - | === Update vzlogger | + | === Daemon |
| + | At this point a daemon-service should be prepared to run vzlogger in backgroung. Details [[/ | ||
| + | === Update vzlogger === | ||
| + | If a update is necessary follow these steps: | ||
| < | < | ||
| - | sudo systemctl stop vzlogger #only works after creating the systemd start script, see below | ||
| 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 | + | |
| </ | </ | ||
| - | |||
| - | if you are having trouble building with libsml, instead of just "cmake .", use: | ||
| - | < | ||
| - | cmake .. -DSML_HOME=/ | ||
| - | </ | ||
| - | |||
| - | a debian package can be generated using: | ||
| - | < | ||
| - | cpack -G DEB | ||
| - | </ | ||
| - | |||
| - | === Cross compiling === | ||
| - | |||
| - | < | ||
| - | cmake -DCMAKE_TOOLCHAIN_FILE=/ | ||
| - | </ | ||
| - | |||
| ====== 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:// |
| + | < | ||
| <note important> | <note important> | ||
| Zeile 177: | 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 ====== | ||
| + | |||
| + | === debian package === | ||
| + | a debian package can be generated using: | ||
| + | < | ||
| + | cpack -G DEB | ||
| + | </ | ||
| + | |||
| + | === Cross compiling === | ||
| + | < | ||
| + | cmake -DCMAKE_TOOLCHAIN_FILE=/ | ||
| + | </ | ||
| + | |||
software/controller/vzlogger/installation_en.1490151327.txt.gz · Zuletzt geändert: von jau