<div dir="auto">Great to see you have solved this!<div dir="auto"><br></div><div dir="auto"> Just for posterity: normally NUT server (upsd) won't start without any devices configured. In master branch, an ALLOW_NO_DEVICE patch was added some time ago to let upsd run always. So that should be in 2.7.5 eventually.</div><div dir="auto"><br></div><div dir="auto">As part of that context, a service reload operation should tell the running upsd to slurp new configuration and see newly added devices (without an outage for ones it already serves). I wonder if it would also help with such USB reconnections.</div><div dir="auto"><br></div><div dir="auto">I think upsd ability to reconfigure could be in 2.7.4 already, not at a computer now to check. Probably the systemd unit would need an ExecReload line like one in master branch on github.</div><div dir="auto"><br></div><div dir="auto">Jim Klimov</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 17, 2021, 15:54 Maxence Rioblanc <<a href="mailto:maxence.rioblanc@ixblue.com">maxence.rioblanc@ixblue.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="FR" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="m_-7962086533169765783WordSection1"><p class="MsoNormal">Hi Bart,<u></u><u></u></p><p class="MsoNormal">Thanks for the clue.<u></u><u></u></p><p class="MsoNormal"><span lang="EN-US">I tried and managed to make it works by modifying the udev rule I was working with.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Not sure if this is 100% correct but I can now recover my UPS when I hotplug it:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">/etc/udev/rules.d/</span><span lang="EN-US"> </span><span lang="EN-US">90-nut-ups.rules<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"># ECUS UPS<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0001", ATTR{idProduct}=="0000", MODE="0664", GROUP="nut", RUN+="/usr/bin/systemctl restart nut-server.service"<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Maxence<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span>De :</span></b><span> Bart J. Smit <bart@smits.scot> <br><b>Envoyé :</b> mercredi 17 novembre 2021 13:45<br><b>À :</b> Maxence Rioblanc <<a href="mailto:maxence.rioblanc@ixblue.com" target="_blank" rel="noreferrer">maxence.rioblanc@ixblue.com</a>>; <a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank" rel="noreferrer">nut-upsuser@alioth-lists.debian.net</a><br><b>Objet :</b> RE: UPS hotplug<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-GB">You can add a udev script to restart NUT when the UPS is plugged in <a href="https://wiki.debian.org/udev" target="_blank" rel="noreferrer">https://wiki.debian.org/udev</a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Nut-upsuser <<a href="mailto:nut-upsuser-bounces+bart=smits.co.uk@alioth-lists.debian.net" target="_blank" rel="noreferrer">nut-upsuser-bounces+bart=smits.co.uk@alioth-lists.debian.net</a>> <b>On Behalf Of </b>Maxence Rioblanc<br><b>Sent:</b> 16 November 2021 11:55<br><b>To:</b> <a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank" rel="noreferrer">nut-upsuser@alioth-lists.debian.net</a><br><b>Subject:</b> [Nut-upsuser] UPS hotplug<u></u><u></u></span></p></div></div><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I’m using nut for few days and found it working perfectly fine in most conditions. However, there is one behavior I am not able to handle correctly:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">When I boot my computer (I am in a mode=standalone configuration) while my UPS is not connected and that I plug it (using USB cable) later, the driver doesn’t mount automatically, and I am not able to enable communication with my UPS.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I need to restart nut-server.service to get communication established.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Is there any way to make this hot plug works?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">My configuration:<u></u><u></u></span></p><ul style="margin-top:0cm" type="disc"><li class="m_-7962086533169765783MsoListParagraph" style="margin-left:0cm"><span lang="EN-US">Debian 11<u></u><u></u></span></li><li class="m_-7962086533169765783MsoListParagraph" style="margin-left:0cm"><span lang="EN-US">NUT 2.7.4-13 installed from apt-get<u></u><u></u></span></li><li class="m_-7962086533169765783MsoListParagraph" style="margin-left:0cm"><span lang="EN-US">UPS: ECUS MRT_2_1000 running fine with blazer_usb driver<u></u><u></u></span></li><li class="m_-7962086533169765783MsoListParagraph" style="margin-left:0cm"><span lang="EN-US"><u></u> <u></u></span></li></ul><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Maxence<u></u><u></u></span></p></div></div>_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank" rel="noreferrer">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>