-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Content-ID:
El 18/11/08, Carlos E. R. escribió:
Jupe, es verdad, lo pone en el indice. Yo mirando a ver si lo habías visto en el html source... <=:-)
:-)
Aquí está el hilo de la lista donde hablaban del sai:
[Nut-upsuser] nut with Belkin "Active Battery Backup" UPS (BU30 series) http://lists.alioth.debian.org/pipermail/nut-upsuser/2008-February/003753.ht...
Para darte más trabajo >:-)
Contro. Pues estuve mirando un poco y no me salió nada. No lo haría bien. Voy viendo cosas. He cambiado una linea en el script /etc/init.d/upsd: #$UPSDRVCTL_BIN start >/dev/null 2>&1 || rc_failed $UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 || rc_failed Y esto es lo que contiene ese fichero: cer@nimrodel:~> cat /tmp/ups.log Megatec protocol UPS detected. Startup timer elapsed, continuing... Network UPS Tools - UPS driver controller 2.2.2 cer@nimrodel:~> Y coincide, algo falla y a los 45" aborta - y al fallar ya ni siquiera continua tratando de arrancar el monitorizador, aunque el driver sí queda cargado (veo elproceso, y si desenchufo la SAI protesta). Gracias al hilo que me has dicho, he descubierto el comando para verificar la SAI, que genera una salida algo interesante y precida a la del hilo: nimrodel:/etc/init.d # /usr/lib/ups/driver/megatec_usb -DDDD -a myups Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb] Carlos Rodrigues (c) 2003-2008 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb] Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007 debug level is '4' Checking device (0665/5161) (003/026) - - VendorID: 0665 - - ProductID: 5161 - - Manufacturer: Cypress Semiconductor - - Product: USB to Serial - - Serial Number: unknown - - Bus: 003 Trying to match device Device matches Starting UPS detection process... Asking for UPS status [Q1]... Q1 => OK [(231.3 231.3 230.8 020 49.9 13.6 25.0 00001001] Asking for UPS status [Q1]... Q1 => OK [(231.3 230.8 230.8 018 49.9 13.6 25.0 00001001] Asking for UPS status [Q1]... Q1 => OK [(230.8 231.3 231.3 019 49.9 13.6 25.0 00001001] Asking for UPS status [Q1]... Q1 => OK [(231.3 231.3 231.3 018 49.9 13.6 25.0 00001001] Asking for UPS status [Q1]... Q1 => OK [(231.3 230.8 231.3 020 49.9 13.6 25.0 00001001] 0 out of 5 detection attempts failed (minimum failures: 2). Cancelling any pending shutdown or battery test. Asking for UPS information [I]... I => FAILED [short read] <=================== I detail: (0 bytes) => Megatec protocol UPS detected. Parameter [ignoreoff]: [false] Asking for UPS power ratings [F]... F => OK [#230.0 002 12.00 50.0] 12.0V battery, interval [9.7V, 13.7V]. Done setting up the UPS. Asking for UPS status [Q1]... Q1 => OK [(231.3 231.3 231.3 020 49.9 13.6 25.0 00001001] Calculated battery charge: 97.5% dstate_init: sock /var/lib/ups/megatec_usb-myups open on fd 5 Asking for UPS status [Q1]... Q1 => OK [(233.3 233.3 232.8 020 49.9 13.6 25.0 00001001] Calculated battery charge: 97.5% Asking for UPS status [Q1]... Q1 => OK [(232.8 232.8 233.3 020 49.9 13.6 25.0 00001001] Calculated battery charge: 97.5% Asking for UPS status [Q1]... ^CQ1 => OK [(232.8 232.8 232.8 019 49.9 13.6 25.0 00001001] Calculated battery charge: 97.5% Signal 2: exiting nimrodel:/etc/init.d # Y sigue sin parar preguntando ese "Q1" sin parar. Desde luego consigue conectar. He vuelto a cambiar la linea del script de inicio a esta otra: strace -ff -o /tmp/ups_trace $UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 || rc_failed Esto tiene el efecto secundario de que nunca termina y hay que matar los procesos, pero he conseguido ver algo. /tmp/ups_trace.4803: El primer proceso es "/usr/lib/ups/driver/upsdrvctl" y de lo ultimo que hace es arrancar "/usr/lib/ups/driver/megatec_usb" (4804) /tmp/ups_trace.4804 Veo que hace: connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused) y efectivamente, el "nscd" está muerto, es un bug que ya reporté. Vuelvo a intentarlo con el daemon ejecutandose. Vale, tengo PID 5352, 5353 y 5389, y no termina. Le hago un kill a los tres. /tmp/ups_trace.5352 /usr/lib/ups/driver/upsdrvctl Arranca el otro proceso: /tmp/ups_trace.5353 /usr/lib/ups/driver/megatec_usb parece que el problema es este: open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/001", O_RDONLY) = 5 ioctl(5, USBDEVFS_CONNECTINFO, 0xbfff3834) = -1 EPERM (Operation not permitted) ... ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 ENOTTY (Inappropriate ioctl for device) close(4) = 0 open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/001", O_RDONLY) = 4 ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 EPERM (Operation not permitted) y parece que se mete en un bucle de espera: ioctl(4, USBDEVFS_SETINTERFACE, 0xbfff58a4) = 0 gettimeofday({1227040766, 257390}, NULL) = 0 ioctl(4, USBDEVFS_SUBMITURB, 0xbfff7024) = 0 ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily unavailable) select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout) gettimeofday({1227040766, 257974}, NULL) = 0 ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily unavailable) select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout) gettimeofday({1227040766, 261832}, NULL) = 0 ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily unavailable) select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout) Hay otro proceso arrancado, su log es "/tmp/ups_trace.5389", pero no dice que es. Tiene este problema: gettimeofday({1227040824, 883850}, NULL) = 0 ioctl(4, USBDEVFS_SUBMITURB, 0xbfff6f84) = 0 ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily unavailable) select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout) gettimeofday({1227040824, 885955}, NULL) = 0 ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily unavailable) select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout) Lo que no sé, es cual es el fichero abierto al que corresponde el descriptor "4", porque los "open" que veo son el 6 y el 5. Creo que es un log incompleto, el strace tarda un tiempo en conectarse a los hijos y ha llegado tarde. Yo diría que el driver, al correr como usuario "upsd" no tiene acceso al USB. Configuro: [myups] driver = megatec_usb port = auto desc = "BELKIN Active Battery Backup" user = root ¡Y arranca al isntante! ¡JA! nimrodel:~ # time rcupsd start User: root Owner: root:root Port: auto Starting NUT UPS drivers done Starting NUT UPS server done Starting NUT UPS monitor done real 0m0.252s user 0m0.052s sys 0m0.096s nimrodel:~ # time rcupsd status Checking for service NUT UPS server running Checking for service NUT UPS monitor running real 0m0.065s user 0m0.032s sys 0m0.032s Lo que pasa es que ahora me atosiga con otro error en casi todas las consolas: Broadcast Message from upsd@nimrodel (somewhere) at 21:58 ... Communications with UPS myups@localhost lost Nov 18 21:58:19 nimrodel upsmon[5798]: Poll UPS [myups@localhost] failed - Driver not connected Nov 18 21:58:19 nimrodel upsmon[5798]: UPS myups@localhost is unavailable Nov 18 21:58:24 nimrodel upsmon[5798]: Poll UPS [myups@localhost] failed - Driver not connected Nov 18 21:58:39 nimrodel syslog-ng[2899]: last message repeated 3 times Nov 18 21:58:44 nimrodel upsmon[5798]: Poll UPS [myups@localhost] failed - Driver not connected Nov 18 21:58:44 nimrodel upsmon[5798]: Poll UPS [myups@localhost] failed - Driver not connected Creo que se por donde va esto... no, no he acertado. nimrodel:~ # upscmd -l myups Error: Driver not connected cer@nimrodel:~> cat /tmp/ups.log Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb] Carlos Rodrigues (c) 2003-2008 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb] Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007 Fatal error: 'user' is not a valid variable name for this driver. Look in the man page or call this driver with -h for a list of valid variable names and flags. Network UPS Tools - UPS driver controller 2.2.2 Pues es gracioso, porque sé que sí lo estaba aceptando, se ejecutaba como root. Entonces pruebo con run_as root ....tampoco, falla. [...] Bueno, ya seguiré pensando, mi cena se retrasa. Imagino que tendré que usar la versión cvs. - -- Saludos Carlos E.R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkjQU4ACgkQtTMYHG2NR9UmzwCfWHPgkttqyql6X7Hs5oVM0Qfr XA0AnjciX3EnIpA4K87Fz8xQJJ8J1UEE =WdVz -----END PGP SIGNATURE-----