Arjen de Korte
2007-Jun-06 07:05 UTC
[Nut-upsdev] Autodetecting running drivers by the 'upsd' server
Currently, the 'upsd' server uses 'ups.conf' to find out which drivers should be running and uses this information to construct the socketname it needs. This means that drivers that have not been configured in 'ups.conf' can never be seen by the server. If we ever want to autodetect (by whatever means) what drivers are started (udev?) and we start them automatically, this probably means these drivers will not be configured in 'ups.conf' either and won't be seen. What we could also do, is to let the server checkout the contents of the STATEPATH and contact to all sockets it finds there. This would also do away with the necessity to keep the socketnames in the drivers and the server in sync. There are two caveats though: 1) Drivers must have created their socket before the server is started. This is not different from what we have now, but the server wouldn't be able to detect that a driver which should be running (according to 'ups.conf') is not available. Personally, I don't think this is not much of a problem as long as 'upsdrvctl' complains about this (which it usually does). 2) The STATEPATH should be dedicated for the driver, since the server can't know in advance if a socket is for a NUT driver or some other application that happens to be using the same directory for its sockets. I don't think this is a big problem though. Any thoughts on this? Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
Daniel O'Connor
2007-Jun-06 10:43 UTC
[Nut-upsdev] Autodetecting running drivers by the 'upsd' server
On Wednesday 06 June 2007 16:35, Arjen de Korte wrote:> 1) Drivers must have created their socket before the server is > started. This is not different from what we have now, but the server > wouldn't be able to detect that a driver which should be running > (according to 'ups.conf') is not available. Personally, I don't think > this is not much of a problem as long as 'upsdrvctl' complains about > this (which it usually does).The server could periodically look for new sockets (and/or on SIGHUP).> 2) The STATEPATH should be dedicated for the driver, since the server > can't know in advance if a socket is for a NUT driver or some other > application that happens to be using the same directory for its > sockets. I don't think this is a big problem though.The nut directory in /var should be for the exclusive use of NUT anyway, for security (that way you can chown the directory to the nut user) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070606/c4847336/attachment.pgp