Add systemd configuration.
This commit is contained in:
parent
06fad3b0ca
commit
f32072e997
2 changed files with 59 additions and 2 deletions
39
systemd/opendtu-logger.service
Normal file
39
systemd/opendtu-logger.service
Normal file
|
@ -0,0 +1,39 @@
|
|||
GNU nano 7.2 /etc/systemd/system/opendtu-logger.service
|
||||
[Unit]
|
||||
Description=OpenDTU Logger
|
||||
Documentation=https://git.hollander.online/energy/opendtu-logger
|
||||
After=network.target auditd.service
|
||||
|
||||
# If using a PostgreSQL DB on the local machine, uncomment the following additional "After" and "Require" sections.
|
||||
## PostgreSQL
|
||||
# After=postgresql.service
|
||||
# Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
RestartSec=10s
|
||||
Type=simple
|
||||
|
||||
User=opendtu-logger
|
||||
Group=opendtu-logger
|
||||
|
||||
Environment="REMOTE_URL=opendtu.local:80"
|
||||
Environment="DB_URL=host=localhost port=5432 user=postgres password=secret dbname=dtu sslmode=disable"
|
||||
Environment="TIMESCALEDB_ENABLED=true"
|
||||
Environment="TZ=Europe/Amsterdam"
|
||||
|
||||
WorkingDirectory=/opt/opendtu-logger/
|
||||
ExecStart=/opt/opendtu-logger/opendtu-logger
|
||||
Restart=always
|
||||
|
||||
# Isolate OpenDTU Logger from the rest of the system
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
ProtectHome=true
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
|
||||
# Only allow writes to the following directories
|
||||
ReadWritePaths=/opt/opendtu-logger/data/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue