FS#68571 - [nut] dd restart systemd service on crash functionality.... for NUT package

Attached to Project: Community Packages
Opened by qaron (qaron) - Monday, 09 November 2020, 07:45 GMT
Last edited by Maxime Gauduin (Alucryd) - Thursday, 18 August 2022, 10:32 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
you could edit those file and implement restarting the service on crash. we are talking about Network UPS Tools. the service is working great with zero problems, but sometimes the service crashes.
there is a possibility that in those times you'll need the service to be functional in order to power down your system. if the service is crashed, while on power outage [you've got no protection and no shutdown].
https://ma.ttias.be/auto-restart-crashed-service-systemd/

nut-monitor.service:
[Unit]
Description=Network UPS Tools - power device monitor and shutdown controller
After=local-fs.target network.target nut-server.service
[Service]
ExecStart=/usr/bin/upsmon
PIDFile=/run/nut/upsmon.pid
Type=forking
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target

nut-server.service:
[Unit]
Description=Network UPS Tools - power devices information server
After=local-fs.target network.target nut-driver.service
# 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.service
Before=nut-monitor.service
[Service]
ExecStart=/usr/bin/upsd
Type=forking
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target

nut-driver.service:
[Unit]
Description=Network UPS Tools - power device driver controller
After=local-fs.target network.target
StopWhenUnneeded=yes
[Service]
ExecStart=/usr/bin/upsdrvctl start
ExecStop=/usr/bin/upsdrvctl stop
Type=forking
Restart=on-failure
RestartSec=5s
This task depends upon

Closed by  Maxime Gauduin (Alucryd)
Thursday, 18 August 2022, 10:32 GMT
Reason for closing:  Won't implement
Comment by qaron (qaron) - Monday, 09 November 2020, 07:49 GMT
up until now i was editing manually those files and restarting those services in order to avoid any problems but every time that an update was available it rewrote those changes. I was back in square one again.. thanks
Comment by Maxime Gauduin (Alucryd) - Thursday, 18 August 2022, 10:31 GMT
@qaron You could use `systemctl edit` to edit the files instead, changes will then persist across updates. We try to keep our packages as vanilla as possible, so such a change should be pushed upstream instead.

Loading...