Great to see you have solved this! 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.
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. 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. Jim Klimov On Wed, Nov 17, 2021, 15:54 Maxence Rioblanc <maxence.riobl...@ixblue.com> wrote: > Hi Bart, > > Thanks for the clue. > > I tried and managed to make it works by modifying the udev rule I was > working with. > > Not sure if this is 100% correct but I can now recover my UPS when I > hotplug it: > > /etc/udev/rules.d/ 90-nut-ups.rules > > > > > > # ECUS UPS > > > > ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0001", > ATTR{idProduct}=="0000", MODE="0664", GROUP="nut", RUN+="/usr/bin/systemctl > restart nut-server.service" > > > > > > Best regards, > > Maxence > > > > *De :* Bart J. Smit <b...@smits.scot> > *Envoyé :* mercredi 17 novembre 2021 13:45 > *À :* Maxence Rioblanc <maxence.riobl...@ixblue.com>; > nut-upsuser@alioth-lists.debian.net > *Objet :* RE: UPS hotplug > > > > You can add a udev script to restart NUT when the UPS is plugged in > https://wiki.debian.org/udev > > > > *From:* Nut-upsuser < > nut-upsuser-bounces+bart=smits.co...@alioth-lists.debian.net> *On Behalf > Of *Maxence Rioblanc > *Sent:* 16 November 2021 11:55 > *To:* nut-upsuser@alioth-lists.debian.net > *Subject:* [Nut-upsuser] UPS hotplug > > > > Hello, > > > > 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: > > 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. > > I need to restart nut-server.service to get communication established. > > Is there any way to make this hot plug works? > > > > My configuration: > > - Debian 11 > - NUT 2.7.4-13 installed from apt-get > - UPS: ECUS MRT_2_1000 running fine with blazer_usb driver > - > > > > > > Regards, > > Maxence > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser@alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >
_______________________________________________ Nut-upsuser mailing list Nut-upsuser@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser