software:controller:vzlogger:installation_en
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
software:controller:vzlogger:installation_en [2019/04/24 18:13] – MQTT dependencie 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 35: | Zeile 36: | ||
=== 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 76: | Zeile 74: | ||
In cases the script does not fit the conditions. | In cases the script does not fit the conditions. | ||
<note warning> | <note warning> | ||
- | |||
- | === Building libjson === | ||
- | |||
- | The best case is building libjson from source, which is simple too: | ||
- | < | ||
- | git clone -b json-c-0.12 https:// | ||
- | cd json-c | ||
- | sh autogen.sh | ||
- | ./configure | ||
- | make | ||
- | sudo make install | ||
- | </ | ||
- | |||
- | Go back to your starting directory: < | ||
=== 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 115: | 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 159: | Zeile 149: | ||
Systemd is used to install and execute services in background (daemon). | 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 182: | 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.txt · Zuletzt geändert: 2023/03/13 07:57 von jau