I'm trying to see if we can make upsd autodetect the driver sockets from the STATEPATH. This works quite well and uses surprisingly little code (much less than parsing the 'ups.conf' file). However, since I can no longer read the name from the 'ups.conf' file, I need to extract this from the name of the socket. We might simply strip the drivername from the socket name again, but I really don't want to do that, since it won't allow us to define our own names (for autodetected UPSes) anymore. Unfortunately, we're clean out of potential separation characters. Unless I use a double '_' or '-' (the '.' is not an option), we're stuck. Therefor I want to propose to reserve the '_' character in driver names, so that this is available again for this purpose. Currently, three drivers use a '_' in their names: bcmxcp_usb megatec_usb tripplite_usb Since these are fairly recent additions (from the last two years), would it be OK to rename them to bcmxcp-usb megatec-usb tripplite-usb Or would this cause too much grief downstream? The alternative is to use a double '_' as separator character, but personally, I thinks this looks bug__ugly. :-) Best regards, Arjen
oss-list-ups at technorama.net
2007-Jun-08 06:56 UTC
[Nut-upsdev] Reserve '_' in driver names?
Instead of modifying upsd why not ship a default ups.conf that contains a default driver named ['default' | 'automatic' | 'auto']? USB and other devices that can be autodetected/started could use the default name included in ups.conf. On Thu, Jun 07, 2007 at 09:11:09PM +0200, Arjen de Korte wrote:> I'm trying to see if we can make upsd autodetect the driver sockets from > the STATEPATH. This works quite well and uses surprisingly little code > (much less than parsing the 'ups.conf' file). However, since I can no > longer read the name from the 'ups.conf' file, I need to extract this > from the name of the socket. We might simply strip the drivername from > the socket name again, but I really don't want to do that, since it > won't allow us to define our own names (for autodetected UPSes) anymore. > > Unfortunately, we're clean out of potential separation characters. > Unless I use a double '_' or '-' (the '.' is not an option), we're > stuck. Therefor I want to propose to reserve the '_' character in driver > names, so that this is available again for this purpose. > > Currently, three drivers use a '_' in their names: > > bcmxcp_usb > megatec_usb > tripplite_usb > > Since these are fairly recent additions (from the last two years), would > it be OK to rename them to > > bcmxcp-usb > megatec-usb > tripplite-usb > > Or would this cause too much grief downstream? The alternative is to use > a double '_' as separator character, but personally, I thinks this looks > bug__ugly. :-) > > Best regards, Arjen
[ renaming drivers ]> Or would this cause too much grief downstream? The alternative is to use > a double '_' as separator character, but personally, I thinks this looks > bug__ugly. :-)Never mind this message. The driver name is irrelevant for the socket name. One can query which driver is used from the UPS data structures, so we can also use 'user-' and 'auto-' as prefixes, to make a distinction between user- and automatically configured UPS'es. Therefor, I withdraw this proposal, it has no merit. Since hot(un)pluggable UPS'es won't have an 'ups.conf' entry, I will make the option to start a driver without an entry there available again in the trunk, once the server picks up the drivers to connect to from the STATEPATH, rather than from 'ups.conf'. Best regards, Arjen