# acpid y eventos de la batería

## afb

Tengo instalado el acpid y el suspend2. Quiero que cuando la máquina este trabajando con la batería y le quede poca carga hiberne.

El problema radica en que acpid no está recibiendo los eventos de la batería.

No crea nada en la carpeta /proc/acpid/battery/

Que puede ser??

nota: Tengo instalado apcupsd y trabaja de maravillas, pero manda a apagar en vez de hibernar

----------

## Stolz

¿tienes configurado el kernel con soporte acpi?¿Agregaste soporte para la batería? Si lo hiciste como módulo ¿está el módulo cargado?

Necesitamos más datos:

```
dmesg | grep  -i acpi

tail -n 50 /var/log/acpid

cat /etc/acpi/events/battery
```

¿tienes instalado laptop-mode-tools? ¿se está ejecutando?¿Como lo has configurado?

----------

## afb

La Salida de dmesg | grep -i acpi

 BIOS-e820: 000000007f675000 - 000000007f6e8000 (ACPI NVS)

 BIOS-e820: 000000007f6ec000 - 000000007f6ff000 (ACPI data)

ACPI: RSDP 000FE020, 0014 (r0 INTEL )

ACPI: RSDT 7F6FDE48, 0050 (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: FACP 7F6FCF10, 0074 (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: DSDT 7F6F7010, 42BF (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: FACS 7F6DEC40, 0040

ACPI: APIC 7F6FCE10, 0078 (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: WDDT 7F6F6F90, 0040 (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: MCFG 7F6F6F10, 003C (r1 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: ASF! 7F6FCD10, 00A6 (r32 INTEL  D945GTP       F9C MSFT  1000013)

ACPI: SSDT 7F6FDC10, 01BC (r1 INTEL     CpuPm      F9C MSFT  1000013)

ACPI: SSDT 7F6FDA10, 0175 (r1 INTEL   Cpu0Ist      F9C MSFT  1000013)

ACPI: SSDT 7F6FD810, 0175 (r1 INTEL   Cpu1Ist      F9C MSFT  1000013)

ACPI: SSDT 7F6FD610, 0175 (r1 INTEL   Cpu2Ist      F9C MSFT  1000013)

ACPI: SSDT 7F6FD410, 0175 (r1 INTEL   Cpu3Ist      F9C MSFT  1000013)

ACPI: SSDT 7F6F6E90, 002F (r1 INTEL  SetupVar      F9C MSFT  1000013)

ACPI: PM-Timer IO Port: 0x408

ACPI: Local APIC address 0xfee00000

ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)

ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)

ACPI: LAPIC (acpi_id[0x03] lapic_id[0x82] disabled)

ACPI: LAPIC (acpi_id[0x04] lapic_id[0x83] disabled)

ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])

ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1])

ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])

ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)

ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)

ACPI: IRQ0 used by override.

ACPI: IRQ2 used by override.

ACPI: IRQ9 used by override.

Using ACPI (MADT) for SMP configuration information

ACPI: Core revision 20070126

ACPI: bus type pci registered

ACPI: Interpreter enabled

ACPI: (supports S0 S1 S3 S4 S5)

ACPI: Using IOAPIC for interrupt routing

ACPI: PCI Root Bridge [PCI0] (0000:00)

PCI quirk: region 0400-047f claimed by ICH6 ACPI/GPIO/TCO

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.P32_._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX2._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX3._PRT]

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11 12)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 11 12) *0, disabled.

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 *9 10 11 12)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 *11 12)

ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 9 *10 11 12)

ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 10 11 12) *0, disabled.

ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 *9 10 11 12)

ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 9 *10 11 12)

pnp: PnP ACPI init

ACPI: bus type pnp registered

pnp: PnP ACPI: found 13 devices

ACPI: ACPI bus type pnp unregistered

PCI: Using ACPI for IRQ routing

ACPI: PCI Interrupt 0000:00:1c.0[A] -> GSI 17 (level, low) -> IRQ 17

ACPI: PCI Interrupt 0000:00:1c.2[C] -> GSI 18 (level, low) -> IRQ 18

ACPI: PCI Interrupt 0000:00:1c.3[D] -> GSI 19 (level, low) -> IRQ 19

ACPI: Power Button (FF) [PWRF]

ACPI: Sleep Button (CM) [SLPB]

ACPI: PCI Interrupt 0000:00:1f.1[A] -> GSI 18 (level, low) -> IRQ 18

ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19

ACPI: PCI Interrupt 0000:00:1d.7[A] -> GSI 23 (level, low) -> IRQ 23

ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 23

ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19

ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 18

ACPI: PCI Interrupt 0000:00:1d.3[D] -> GSI 16 (level, low) -> IRQ 16

ACPI: PCI Interrupt 0000:04:08.0[A] -> GSI 20 (level, low) -> IRQ 20

parport_pc 00:08: reported by Plug and Play ACPI

ACPI: PCI Interrupt 0000:00:1f.3[B] -> GSI 19 (level, low) -> IRQ 19

ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) -> IRQ 22

La del tail -n 50 /var/log/acpid

[Fri Nov  2 20:54:47 2007] END HANDLER MESSAGES

[Fri Nov  2 20:54:47 2007] action exited with status 0

[Fri Nov  2 20:54:47 2007] completed event "button/power PWRF 00000080 00000001"

[Fri Nov  2 20:55:27 2007] exiting

[Fri Nov  2 20:55:27 2007] starting up

[Fri Nov  2 20:55:27 2007] 1 rule loaded

[Fri Nov  2 20:55:28 2007] client connected from 7240[0:0]

[Fri Nov  2 20:55:28 2007] 1 client rule loaded

[Fri Nov  2 20:55:31 2007] received event "button/power PWRF 00000080 00000002"

[Fri Nov  2 20:55:31 2007] notifying client 7240[0:0]

[Fri Nov  2 20:55:31 2007] executing action "/etc/acpi/default.sh button/power PWRF 00000080 00000002"

[Fri Nov  2 20:55:31 2007] BEGIN HANDLER MESSAGES

[Fri Nov  2 20:55:31 2007] END HANDLER MESSAGES

[Fri Nov  2 20:55:31 2007] action exited with status 0

[Fri Nov  2 20:55:31 2007] completed event "button/power PWRF 00000080 00000002"

[Fri Nov  2 20:56:44 2007] exiting

[Fri Nov  2 20:56:44 2007] starting up

[Fri Nov  2 20:56:44 2007] 1 rule loaded

[Fri Nov  2 20:56:45 2007] client connected from 7240[0:0]

[Fri Nov  2 20:56:45 2007] 1 client rule loaded

[Fri Nov  2 20:56:48 2007] received event "button/power PWRF 00000080 00000003"

[Fri Nov  2 20:56:48 2007] notifying client 7240[0:0]

[Fri Nov  2 20:56:48 2007] executing action "/etc/acpi/default.sh button/power PWRF 00000080 00000003"

[Fri Nov  2 20:56:48 2007] BEGIN HANDLER MESSAGES

[Fri Nov  2 20:56:48 2007] END HANDLER MESSAGES

[Fri Nov  2 20:56:48 2007] action exited with status 0

[Fri Nov  2 20:56:48 2007] completed event "button/power PWRF 00000080 00000003"

[Fri Nov  2 21:26:49 2007] exiting

[Fri Nov  2 21:26:49 2007] starting up

[Fri Nov  2 21:26:49 2007] 1 rule loaded

[Fri Nov  2 21:26:50 2007] client connected from 7240[0:0]

[Fri Nov  2 21:26:50 2007] 1 client rule loaded

[Fri Nov  2 21:28:09 2007] received event "button/power PWRF 00000080 00000004"

[Fri Nov  2 21:28:09 2007] notifying client 7240[0:0]

[Fri Nov  2 21:28:09 2007] executing action "/etc/acpi/default.sh button/power PWRF 00000080 00000004"

[Fri Nov  2 21:28:09 2007] BEGIN HANDLER MESSAGES

[Fri Nov  2 21:28:09 2007] END HANDLER MESSAGES

[Fri Nov  2 21:28:09 2007] action exited with status 0

[Fri Nov  2 21:28:09 2007] completed event "button/power PWRF 00000080 00000004"

[Fri Nov  2 21:28:19 2007] exiting

[Sat Nov  3 09:29:55 2007] starting up

[Sat Nov  3 09:29:55 2007] 1 rule loaded

[Sat Nov  3 09:29:56 2007] client connected from 6319[102:1002]

[Sat Nov  3 09:29:56 2007] 1 client rule loaded

[Sat Nov  3 09:30:04 2007] client connected from 7235[0:0]

[Sat Nov  3 09:30:04 2007] 1 client rule loaded

Este es el event/default

event=.*

action=/etc/acpi/default.sh %e

Tengo compilado el kernel con soporte para acpi y la batería como parte del kernel no como módulo.

No tengo instalado laptop-mode-tools porque lo que tengo no es una laptop y no creí que me hiciera falta

----------

## Stolz

Las salida parece correcta. ACPI está funcionando pero no se aprecia rastro de la batería.

Antes de seguir buscando una causa, aclárame una cosa que no entiendo.  Si tu ordenador no es un laptop ¿qué tipo de máquina es para que use batería?.

por cierto, imagino que será un error a la hora de escribirlo, pero la ruta correcta para buscar información de la batería es /proc/acpi/battery/ , no /proc/acpid/battery/

----------

## afb

No es una laptop, es una máquina de escritorio, lo que tengo es una UPS  APC. Y en estos dias estoy teniendo problemas con la corriente, y cada vez que dejo haciendo algo y se va la corriente el apcupsd manda a apagar, y yo lo que quiero es que hiberne para no tener que reiniciar la tarea.

----------

## Stolz

Tal vez me equivoque, pero creo que ACPI no tiene nada que ver con los sistemas de alimentación ininterrumpida. Me extrañaría que una batería externa lance eventos de tipo ACPI. Si estás seguro de que es así, no puedo ayudarte, ACPI está bien configurado pero no hay rasto de tu SAI. Yo creo que puedes conseguir lo que quieres sin usar ACPI, tan solo tienes que modificar el archivo de configuración de apcupsd (¿apccontrol?) y cambiar el comando de apagado (¿/sbin/shutdown?) por el de hibernación (¿/usr/sbin/hibernate?).

Saludozzzzzz

----------

