diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2023-11-29 22:19:10 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2023-11-29 22:19:10 +0100 |
| commit | d97d49d593b230f6f3e1266bde14bfa8d04f3c24 (patch) | |
| tree | 73204e82f00cfd4f392bbe1ae8b5b0af3fc1a7af | |
| parent | 76584f79d1ab64fbda7d67aad8ec38a4ee5a17ef (diff) | |
| download | usb-wde1-tools-d97d49d593b230f6f3e1266bde14bfa8d04f3c24.tar.gz usb-wde1-tools-d97d49d593b230f6f3e1266bde14bfa8d04f3c24.zip | |
systemd service file
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | README.rst | 13 | ||||
| -rw-r--r-- | systemd/usb-wde1-log.service | 15 |
3 files changed, 33 insertions, 8 deletions
@@ -3,16 +3,19 @@ PLUGINS = /etc/munin/plugins install: lninstall lninstall: - ln -sf $(abspath init.d/usb-wde-log) /etc/init.d - insserv usb-wde-log + ln -sf $(abspath systemd/usb-wde1-log.service) /etc/systemd/system/ + systemctl daemon-reload + systemctl start usb-wde1-log + systemctl enable usb-wde1-log ln -sf $(abspath munin/usb-wde1_) $(PLUGINS)/usb-wde1_temperature ln -sf $(abspath munin/usb-wde1_) $(PLUGINS)/usb-wde1_humidity uninstall: - service usb-wde-log stop - insserv -r usb-wde-log - rm -f /etc/init.d/usb-wde-log + systemctl stop usb-wde1-log + systemctl disable usb-wde1-log + rm /etc/systemd/system/usb-wde1-log.service + systemctl daemon-reload rm -f $(PLUGINS)/usb-wde1_temperature rm -f $(PLUGINS)/usb-wde1_humidity @@ -31,7 +31,13 @@ Setup once. It backgrounds the logging process and logs into ``/var/spool/usb-wde1/usb-wde1-last``. This process needs to be started whenever the machine is rebooted. - You can run ``make`` to install the init script. + The ``systemd/`` directory contains a ``usb-wde1-log.service`` file you can copy to + ``/etc/systemd/system/``. After copying it, run:: + + $ systemctl daemon-reload + $ systemctl start usb-wde1-log + $ systemctl status usb-wde1-log + $ systemctl enable usb-wde1-log 2. Link the munin plugin:: @@ -39,8 +45,9 @@ Setup $ ln -s /usr/local/src/usb-wde1-tools/munin/usb-wde1_ usb-wde1_temperature $ ln -s /usr/local/src/usb-wde1-tools/munin/usb-wde1_ usb-wde1_humidity -3. Configure the plugins - Edit /etc/munin/plugin-conf.d/munin-node and add the following lines:: +3. Configure the plugins: + + Edit ``/etc/munin/plugin-conf.d/munin-node`` and add the following lines:: [usb-wde1_*] env.logfile /var/spool/usb-wde1/usb-wde1-last diff --git a/systemd/usb-wde1-log.service b/systemd/usb-wde1-log.service new file mode 100644 index 0000000..b069fdb --- /dev/null +++ b/systemd/usb-wde1-log.service @@ -0,0 +1,15 @@ +[Unit] +Description=USB-WDE1-Wetterdatenlogger +After=systemd-udev-settle.service + +[Service] +Type=simple +User=root +Group=root +WorkingDirectory=/usr/local/src/usb-wde1-tools/munin/ +ExecStart=/usr/local/src/usb-wde1-tools/munin/usb-wde1-log-last.sh +Restart=always +RestartSec=30 + +[Install] +WantedBy=multi-user.target |
