Derek Rachul
2013-Sep-12 23:47 UTC
[Nut-upsuser] UPS repeater configuration using localhost
Hello, I'm trying to setup a UPS configuration whereas I have one physical UPS but two UPS entities loaded by the system used by different network slaves. In my ups.conf configuration I have ... [ups] driver = apcsmart port = /dev/ttyS0 desc = "APC UPS" [qnapups] driver = dummy-ups port = ups at localhost desc = "APC UPS for QNAP" ... This use of the repeater mode of the dummy-ups UPS driver doesn't seem to work though, as I get errors Sep 12 15:50:07 upsd[19170]: listening on 0.0.0.0 port 3493 Sep 12 15:50:07 upsd[19170]: Can't connect to UPS [qnapups] (dummy-ups-qnapups): No such file or directory Sep 12 15:50:07 upsd[19170]: Connected to UPS [ups]: apcsmart-ups Sep 12 15:50:07 upsd[19171]: Startup successful I tried reversing the order of the definitions in the config file, and it does seem to change the order in which they're loaded (at least according to the system logs) however the error remains. Does anyone know if there is a way to get this to work, or am I out of luck? Thanks, Derek. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130912/4e1987cf/attachment.html>
Charles Lepple
2013-Sep-16 23:36 UTC
[Nut-upsuser] UPS repeater configuration using localhost
On Sep 12, 2013, at 7:47 PM, Derek Rachul <drachul at gmail.com> wrote:> I tried reversing the order of the definitions in the config file, and it does seem to change the order in which they're loaded (at least according to the system logs) however the error remains.I don't have any experience using the dummy-ups driver on the same host as the real UPS driver, so this is a shot in the dark. Can you manually run "upsdrvctl start qnapups"? If it works that way, we may have a race condition in dummy-ups.
Derek Rachul
2013-Sep-17 00:13 UTC
[Nut-upsuser] UPS repeater configuration using localhost
On Mon, Sep 16, 2013 at 4:36 PM, Charles Lepple <clepple at gmail.com> wrote:> On Sep 12, 2013, at 7:47 PM, Derek Rachul <drachul at gmail.com> wrote: > > > I tried reversing the order of the definitions in the config file, and > it does seem to change the order in which they're loaded (at least > according to the system logs) however the error remains. > > I don't have any experience using the dummy-ups driver on the same host as > the real UPS driver, so this is a shot in the dark. > > Can you manually run "upsdrvctl start qnapups"? If it works that way, we > may have a race condition in dummy-ups.Hi Charles, It appears that if I re-run the command above after the main ups driver is running, that the qnapups dummy-ups driver seems to come up, and the target slave seems to be able to connect to it: # upsdrvctl start qnapups Network UPS Tools - UPS driver controller 2.6.3 Network UPS Tools - Device simulation and repeater driver 0.12 (2.6.3) ... Sep 16 17:05:50 upsd[24756]: listening on 0.0.0.0 port 3493 Sep 16 17:05:50 upsd[24756]: Connected to UPS [ups]: apcsmart-ups Sep 16 17:05:50 upsd[24756]: Can't connect to UPS [qnapups] (dummy-ups-qnapups): No such file or directory Sep 16 17:05:50 upsd[24757]: Startup successful Sep 16 17:05:50 upsd[24757]: User monuser at 127.0.0.1 logged into UPS [ups] Sep 16 17:06:10 upsd[24757]: Connected to UPS [qnapups]: dummy-ups-qnapups I guess there is some sort of timing considerations there. Is there any way to delay the loading of a particular UPS driver? Derek. p.s. sorry to Charles for sending this twice, but I forgot to reply-all first time around. On Mon, Sep 16, 2013 at 4:36 PM, Charles Lepple <clepple at gmail.com> wrote:> On Sep 12, 2013, at 7:47 PM, Derek Rachul <drachul at gmail.com> wrote: > > > I tried reversing the order of the definitions in the config file, and > it does seem to change the order in which they're loaded (at least > according to the system logs) however the error remains. > > I don't have any experience using the dummy-ups driver on the same host as > the real UPS driver, so this is a shot in the dark. > > Can you manually run "upsdrvctl start qnapups"? If it works that way, we > may have a race condition in dummy-ups.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130916/08b28bf4/attachment-0001.html>
Charles Lepple
2013-Sep-17 00:19 UTC
[Nut-upsuser] UPS repeater configuration using localhost
[please keep the list CC'd. Thanks!] On Sep 16, 2013, at 8:11 PM, Derek Rachul <drachul at gmail.com> wrote:> On Mon, Sep 16, 2013 at 4:36 PM, Charles Lepple <clepple at gmail.com> wrote: >> On Sep 12, 2013, at 7:47 PM, Derek Rachul <drachul at gmail.com> wrote: >> >> > I tried reversing the order of the definitions in the config file, and it does seem to change the order in which they're loaded (at least according to the system logs) however the error remains. >> >> I don't have any experience using the dummy-ups driver on the same host as the real UPS driver, so this is a shot in the dark. >> >> Can you manually run "upsdrvctl start qnapups"? If it works that way, we may have a race condition in dummy-ups. > > Hi Charles, > > It appears that if I re-run the command above after the main ups driver is running, that the qnapups dummy-ups driver seems to come up, and the target slave seems to be able to connect to it: > > # upsdrvctl start qnapups > Network UPS Tools - UPS driver controller 2.6.3 > Network UPS Tools - Device simulation and repeater driver 0.12 (2.6.3) > ... > Sep 16 17:05:50 upsd[24756]: listening on 0.0.0.0 port 3493 > Sep 16 17:05:50 upsd[24756]: Connected to UPS [ups]: apcsmart-ups > Sep 16 17:05:50 upsd[24756]: Can't connect to UPS [qnapups] (dummy-ups-qnapups): No such file or directory > Sep 16 17:05:50 upsd[24757]: Startup successful > Sep 16 17:05:50 upsd[24757]: User monuser at 127.0.0.1 logged into UPS [ups] > Sep 16 17:06:10 upsd[24757]: Connected to UPS [qnapups]: dummy-ups-qnapups > > I guess there is some sort of timing considerations there. Is there any way to delay the loading of a particular UPS driver?Not within the current framework, as far as I remember. (I think it's just the shutdown order that is configurable.) What might be better is if the dummy-ups driver tried to reconnect a few times. I haven't really looked at how that might work with the multi-UPS startup code in upsdrvctl, though. upsdrvctl usually waits for some sign of success from each driver. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130916/6818c2a5/attachment.html>