@Kajetan321
I looked into my server and I think I forget some points.
First and foremost I have to say, modifying the systemd files can make you system unbootable! It should not happen, but there is chance since we are also modifying some "natively shipped files". So an update can break your working configuration again and that is not the fault of XCP-NG!!!
That said I assume that after a reboot (prior to any of any input of yours) if you enter:
systemctl status ups-driver.service nut-server.service nut-monitor.service
you will see that "ups-driver.service" is loaded and active, but the 2 other services are not. If thats the case I think I can help you since it is related to a dependency problem during boot up. Please do the following:
Remove "nut-driver.target" dependency from "nut-server.service" by calling
nano /lib/systemd/system/nut-server.service
and remove nut-driver.target from routine. I prefer to duplicate and comment the to be modified rows to keep the original code. It then should look like this. DO NOT COPY AND PASTE, read, compare and modify carefully!
[Unit]
Description=Network UPS Tools - power devices information server
#After=local-fs.target network.target nut-driver.target
After=local-fs.target network.target
# We don't Require drivers to be successfully started! This would be
# a change of behavior compared to init SysV, and could prevent from
# accessing successfully started, at least to audit a system.
#Wants=nut-driver.target
Wants=
# The `upsd` is a networked service (even if bound to a `localhost`)
# so it requires that the OS has some notion of networking already.
# Extending the unit does not require *this* file to be edited, you
# can instead drop in an additional piece of configuration, e.g. add
# a `/etc/systemd/system/nut-server.service.d/network.conf` with:
# [Unit]
# Requires=network-online.target
# After=network-online.target
Requires=network.target
Before=nut-monitor.service
PartOf=nut.target
[Service]
EnvironmentFile=-/etc/ups/nut.conf
SyslogIdentifier=%N
# Note: foreground mode by default skips writing a PID file (and
# needs Type=simple); can use "-FF" here to create one anyway:
ExecStart=/usr/sbin/upsd -F
ExecReload=/usr/sbin/upsd -c reload -P $MAINPID
[Install]
WantedBy=nut.target
Afterwards enable nut.target:
systemctl enable nut.target
Then call:
systemctl daemon-reload
systemctl start nut.target
systemctl start nut-monitor.service
Now it should work even after reboot