feat: Add systemd file and data to integrate the app as a daemon

This commit is contained in:
Sven Sager
2023-10-07 17:15:12 +02:00
committed by Sven Sager
parent c1bd98c444
commit 0380311a9d
4 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Additional options that are passed to revpi-middleware.
# add '-f /var/log/revpi-middleware.log' to write logs to own log file
# add '-v' or '-vv' for verbose logging
DAEMON_OPTS=""
# In addition to journalctl, use your own additional log file
# DAEMON_OPTS="-f /var/log/revpi-middleware.log"

View File

@@ -0,0 +1,14 @@
/var/log/revpi-middleware.log
{
rotate 6
weekly
maxsize 1M
compress
delaycompress
missingok
notifempty
sharedscripts
postrotate
systemctl kill --signal=SIGUSR1 revpi-middleware > /dev/null 2>&1 || true
endscript
}

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Middleware with D-Bus interface for Revolution Pi
After=network.target
[Service]
EnvironmentFile=-/etc/default/revpi-middleware
Type=notify
NotifyAccess=all
ExecStart=/usr/sbin/revpi-middleware $DAEMON_OPTS
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Middleware with D-Bus interface for Revolution Pi
After=network.target
[Service]
EnvironmentFile=-/etc/default/revpi-middleware
Type=notify-reload
NotifyAccess=all
ExecStart=/usr/sbin/revpi-middleware $DAEMON_OPTS
[Install]
WantedBy=multi-user.target