<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>OK, looking at this on my RH8 test image . . .</p>
<p>The first thing that I note, is that the *only* thing that needed
to be set to "enabled" in systemctl (IE "systemctl enable ....")
is the nut.target entry.</p>
<p>All else here are disabled, and "drug along" by nut.target which
ensures that they come up in sequence. <br>
</p>
<p>In nut.target I added to the "After" and "Wants" lines thus to
force it to wait until network startup is complete:</p>
<p>After=local-fs.target nut-driver.target nut-server.service
nut-monitor.service network.target network-online.target<br>
Wants=local-fs.target nut-driver.target nut-server.service
nut-monitor.service network.target network-online.target</p>
<p>This should cause nut.target to not run until the network is up,
and it will start the other nut modules accordingly. <br>
</p>
<p>If the other nut modules (driver, etc) are set to "enabled" they
will autostart independently of nut.target, and you will have a
mess on your hands. <br>
</p>
<p>So far, no errors testing here . . . <br>
</p>
<p>- Tim<br>
</p>
<div class="moz-cite-prefix">On 7/28/24 17:52, Tim Dawson wrote:<br>
</div>
<blockquote type="cite"
cite="mid:840CFEF1-5A1D-4D15-AB84-7BC0CA8BDAA0@tpcsvc.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">Look in the startup logs and see where itnis
starting. I'm not at a RH system at the moment, but at work, I
have had to do this, so can look there,mor perhaps put Nut on
the test RH8 VM I spun up for other rrasons on Friday and work
out the syntax. Not sure if the systemd file you are using came
in the RPM or not, but if it did, it's almost a crime that this
critical detail was overlooked.</div>
<br>
<br>
<div class="gmail_quote">
<div dir="auto">On July 28, 2024 5:33:25 PM EDT, Bill Gee
<a class="moz-txt-link-rfc2396E" href="mailto:bgee@campercaver.net"><bgee@campercaver.net></a> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<pre class="k9mail"><div dir="auto">No luck. I modified both /usr/lib/systemd/system/nut.target and /usr/lib/systemd/nut-server.target The behavior did not change.
Looking at it a bit more, I noticed a comment in /usr/lib/systemd/system/nut-server.service to the effect that the network does not need to be running - merely present - when nut starts. If a running network is wanted, then a new file needs to be added.
I created /etc/systemd/system/nut-server.service.d/network.conf with these three lines:
[Unit]
Requires=network-online.target
After=network-online.target
I ran "systemctl daemon-reload" and rebooted. Still no luck. nut-server did not start during the boot. It starts with no problems when run from a command line:<hr>[root@mythtv ~]# systemctl status nut-server
○ nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
/etc/systemd/system/nut-server.service.d
└─environ.conf, network.conf
Active: inactive (dead)
[root@mythtv ~]# systemctl start nut-server
[root@mythtv ~]# systemctl status nut-server
● nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
/etc/systemd/system/nut-server.service.d
└─environ.conf, network.conf
Active: active (running) since Sun 2024-07-28 16:26:42 CDT; 2s ago
Process: 1703 ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf (code=ex>
Process: 1706 ExecStartPost=/bin/grep -E Units|Max open files /proc/${MAINPID}/limits (code=exited, status=0/SUCCES>
Main PID: 1705 (upsd)
Tasks: 1 (limit: 9460)
Memory: 944.0K (peak: 2.9M)
CPU: 27ms
CGroup: /system.slice/nut-server.service
└─1705 /usr/sbin/upsd -F<hr>Bill Gee
On 7/28/24 13:53, Tim Dawson wrote:
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><div dir="auto">Wants=network.target network-online.target
After=network.target network-online.target
Seems to be the case on RedHat8, and other RedHat based distros should match.
On July 28, 2024 1:56:49 PM EDT, Bill Gee <a class="moz-txt-link-rfc2396E" href="mailto:bgee@campercaver.net"><bgee@campercaver.net></a> wrote:
These files came from the distro package. I did not change anything
myself. Systemd newbie here ...
So the detailed question is - Exactly what change is needed to add
the network-target dependency? I suspect it is not enough to simply
remove the comment symbol on those two lines.<hr> Bill Gee
On 7/28/24 10:10, Tim Dawson wrote:
Seems like you would also want the "network-target" dependency,
since nut will likelynfail without networking being up. (This
would also explwin why the sysctl start ... works after boot,
but not during . . .
On July 28, 2024 10:37:15 AM EDT, Bill Gee
<a class="moz-txt-link-rfc2396E" href="mailto:bgee@campercaver.net"><bgee@campercaver.net></a> wrote:
I have also been having this problem. Checking a few of the files
</div></blockquote><div dir="auto"><hr>Nut-upsuser mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nut-upsuser@alioth-lists.debian.net">Nut-upsuser@alioth-lists.debian.net</a>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" moz-do-not-send="true" class="moz-txt-link-freetext">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>
</div></pre>
</blockquote>
</div>
<div dir="auto">
<div class="k9mail-signature">-- <br>
Sent from my Android device with K-9 Mail. Please excuse my
brevity.</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Nut-upsuser mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nut-upsuser@alioth-lists.debian.net">Nut-upsuser@alioth-lists.debian.net</a>
<a class="moz-txt-link-freetext" href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Tim Dawson
972-567-9360
</pre>
</body>
</html>