File: enphase-monitor%40.service.in

package info (click to toggle)
nut 2.8.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,356 kB
  • sloc: ansic: 123,904; sh: 14,718; cpp: 12,558; makefile: 5,212; python: 1,114; perl: 855; xml: 47
file content (38 lines) | stat: -rw-r--r-- 1,507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Network UPS Tools (NUT) systemd integration
# Copyright (C) 2025 by Scott Shambarger
# Copyright (C) 2025 by NUT contributors
# Distributed under the terms of GPLv2+
# See https://networkupstools.org/
# and https://github.com/networkupstools/nut/

[Unit]
Description=Enphase API monitor for NUT dummy-ups %I
PartOf=nut-driver.target
# NOTE: Works with individual service instances prepared by nut-driver-enumerator
Before=nut-driver@%i.service

[Service]
SyslogIdentifier=%N
# NOTE: Does not have to be same run-time account as NUT daemons, just the
# files created by it should be readable by the dummy-ups daemon. For more
# secured installations, customize this via a drop-in systemd file with a
# different dedicated account:
User=@RUN_AS_USER@
# NOTE: On systems with wear-prone storage (flash/SSD), you can fiddle with
# a "manually-made" file that would be copied into a tmpfs, and have the
# script (and dummy-ups driver) pick up that tmpfs location with initially
# inherited data points, e.g.:
### ExecStartPre=/bin/cp @CONFPATH@/enphase-%I.default /dev/shm/nut/enphase-%I.seq
# First run once to scrap obsolete data from the existing file
# Replace -s with -x to start in nocomms (no network APIs) below:
ExecStartPre=@NUT_LIBEXECDIR@/enphase-monitor -s %I
# Start as the continuously running service
ExecStart=@NUT_LIBEXECDIR@/enphase-monitor %I
Type=exec
# Restart really always, do not stop trying:
StartLimitInterval=0
Restart=always
RestartSec=30

[Install]
WantedBy=nut-driver@%i.service