Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

It seems that Ubuntu runs some script or command when I signal that I want to undock my laptop by pressing the undock button on the dock. Most visible thing that happens is that resolution on external display is changed.

After prepearing for undock my laptop is still connected to power, VGA-output and audio jacks through dock but not to any usb devices or optical drive. I'm running 11.04 on a ThinkPad X61s with X6 UltraBase.

What happens when I signal undocking?

This is what dmesg says after pressing undock button:

[81459.990682] ata1.00: disabled
[81459.990727] ata1.00: detaching (SCSI 0:0:0:0)
[81459.991722] ACPI: \_SB_.GDCK - undocking
[81460.009462] ehci_hcd 0000:00:1a.7: power state changed by ACPI to D0
[81460.020252] ehci_hcd 0000:00:1a.7: BAR 0: set to [mem 0xfe226c00-0xfe226fff] (PCI address [0xfe226c00-0xfe226fff])
[81460.020265] ehci_hcd 0000:00:1a.7: power state changed by ACPI to D0
[81460.020281] ehci_hcd 0000:00:1a.7: restoring config space at offset 0xf (was 0x300, writing 0x30b)
[81460.020309] ehci_hcd 0000:00:1a.7: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900102)
[81460.020338] ehci_hcd 0000:00:1a.7: PME# disabled
[81460.020346] ehci_hcd 0000:00:1a.7: power state changed by ACPI to D0
[81460.020352] ehci_hcd 0000:00:1a.7: power state changed by ACPI to D0
[81460.020363] ehci_hcd 0000:00:1a.7: PCI INT C -> GSI 22 (level, low) -> IRQ 22
[81460.020372] ehci_hcd 0000:00:1a.7: setting latency timer to 64
[81460.020432] ehci_hcd 0000:00:1d.7: power state changed by ACPI to D0
[81460.040071] ehci_hcd 0000:00:1d.7: BAR 0: set to [mem 0xfe227000-0xfe2273ff] (PCI address [0xfe227000-0xfe2273ff])
[81460.040085] ehci_hcd 0000:00:1d.7: power state changed by ACPI to D0
[81460.040104] ehci_hcd 0000:00:1d.7: restoring config space at offset 0xf (was 0x400, writing 0x40b)
[81460.040133] ehci_hcd 0000:00:1d.7: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900102)
[81460.040170] ehci_hcd 0000:00:1d.7: PME# disabled
[81460.040178] ehci_hcd 0000:00:1d.7: power state changed by ACPI to D0
[81460.040184] ehci_hcd 0000:00:1d.7: power state changed by ACPI to D0
[81460.040195] ehci_hcd 0000:00:1d.7: PCI INT D -> GSI 19 (level, low) -> IRQ 19
[81460.040204] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[81460.040503] ehci_hcd 0000:00:1d.7: PCI INT D disabled
[81460.040552] ehci_hcd 0000:00:1d.7: PME# enabled
[81460.061657] ehci_hcd 0000:00:1d.7: power state changed by ACPI to D3
[81460.200414] usb 1-4: USB disconnect, address 14
[81462.220088] ehci_hcd 0000:00:1a.7: PCI INT C disabled
[81462.220169] ehci_hcd 0000:00:1a.7: PME# enabled
[81462.240115] ehci_hcd 0000:00:1a.7: power state changed by ACPI to D3
share|improve this question
    
Here Ubuntu doesn't even seem to recognise the undock button. –  RobinJ Jun 29 '11 at 16:17
    
OP are you still looking for an answer? If so, you may need to repost your question as this is flagged for closure. Regards, –  Ringtail Mar 30 '12 at 4:06
    
I would like to know what happens but I'm not actively searching for an answer. –  Seppo Erviälä Apr 2 '12 at 12:32
add comment

2 Answers 2

up vote 2 down vote accepted

/etc/acpi/events/lenovo-undock or some other similar file corresponding to your laptop defines the ACPI event code for your undock button and maps it to a call to /etc/acpi/undock.sh.

/etc/acpi/undock.sh runs through drivers that correspond to devices that hotplug through your docking station, and signals these drivers to disconnect.

share|improve this answer
add comment

You could also use udev, see here.

share|improve this answer
1  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Mitch Aug 21 '12 at 10:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.