[Nut-upsdev] megatec and some changes to cmdvartab and new-names.txt

Arnaud Quette aquette.dev at gmail.com
Wed Dec 13 14:52:31 CET 2006


2006/12/13, Arjen de Korte <nut+devel at de-korte.org>:
> Arnaud Quette wrote:
>
> > As for the symlink, that won't work since there is a control on the
> > driver name.
>
> I guess I don't really understand what you mean here. I did try this and
> for me, it works.
>
> # ln -s /usr/lib/ups/driver/safenet /usr/lib/ups/driver/foo
>
> [ restart NUT ]
>
> # upsc fenton at localhost
> driver.name: foo
> driver.parameter.manufacturer: Fenton
> driver.parameter.modelname: PowerPal P600E
> driver.parameter.port: /dev/ttyS0
> driver.parameter.serialnumber: 23091046
> driver.version: 2.1.0
> driver.version.internal: 1.0
> ups.mfr: Fenton
> ups.model: PowerPal P600E
> ups.serial: 23091046
> ups.status: OL
>
> So short of the fact that silently symlinking an older driver to a newer
> one may not be a good idea at all (and the problems with incompatible
> differences in the configuration files), what is the problem here?

ok, wrong assertion from (I really don't sleep enough. Still waiting
for the baby to sleep at night ;-).
The control I've mentioned is in drivers/main.c

323         /* don't let the user shoot themselves in the foot */
324         if (!strcmp(var, "driver")) {
325                 if (strcmp(val, progname) != 0)
326                         fatalx("Error: UPS [%s] is for driver %s,
but I'm %s!\n",
327                                 confupsname, val, progname);
328                 return;
329         }

but it's void in your mentioned case, since progname and
ups.conf->driver will be the same...

Arnaud
-- 
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list