File: nut-monitor.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 (52 lines) | stat: -rw-r--r-- 2,273 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Network UPS Tools (NUT) systemd integration
# Copyright (C) 2011-2025 by NUT contributors
# Distributed under the terms of GPLv2+
# See https://networkupstools.org/
# and https://github.com/networkupstools/nut/

[Unit]
Description=Network UPS Tools - power device monitor and shutdown controller
# Note: do not mistake this historic misnomer for "NUT-Monitor" Python GUI client
After=local-fs.target network.target nut-server.service
# Note: We do not specify Requires nut-server.service because
# the `upsd` daemon(s) may be running on a different machine
# (connected to the UPSes) than the `upsmon` shutdown protector.
# The "Wants" directive would try to start the nut-server but
# would not abort if that attempt fails for whatever reason.
Wants=nut-server.service
# Extending the unit does not require *this* file to be edited, you
# can instead drop in an additional piece of configuration, e.g. to
# require the monitoring client to only start after external networking
# is configured (usable IP addresses appear in the system) you can
# add a `/etc/systemd/system/nut-monitor.service.d/network.conf` with:
#   [Unit]
#   Requires=network-online.target
#   After=network-online.target
PartOf=nut.target

Documentation=man:upsmon(@MAN_SECTION_CMD_SYS@)
Documentation=@NUT_WEBSITE_BASE@/docs/man/upsmon.html
Documentation=man:upsmon.conf(@MAN_SECTION_CFG@)
Documentation=@NUT_WEBSITE_BASE@/docs/man/upsmon.conf.html
Documentation=man:nut.conf(@MAN_SECTION_CFG@)
Documentation=@NUT_WEBSITE_BASE@/docs/man/nut.conf.html

[Service]
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
ExecStartPre=-@SYSTEMD_TMPFILES_PROGRAM@ --create @systemdtmpfilesdir@/nut-common-tmpfiles.conf
ExecStart=@SBINDIR@/upsmon @SYSTEMD_DAEMON_ARGS_UPSMON@
ExecReload=@SBINDIR@/upsmon -c reload
PIDFile=@PIDPATH@/upsmon.pid
# If "-FF" or background-daemon mode is used, so that PID file exists
# and "upsmon -c stop" in particular can be used from command-line or
# legacy scripts, it causes a clean and intentional exit of the daemon.
# Then systemd should not revive it - hence restart it only on failure:
Restart=on-failure
Type=@SYSTEMD_DAEMON_TYPE_UPSMON@
@SYSTEMD_DAEMON_WATCHDOG_UPSMON@
@SYSTEMD_DAEMON_NOTIFYACCESS_UPSMON@

[Install]
WantedBy=nut.target
Alias=upsmon.service