@Alex Hung (alexhung) Thank you for the temporary tweak.
After disabling XHC as wakeup, ALS is not waking up the suspended Ubuntu.
But, there should be some fine way to stop only ALS from wakeup rather than the 
XHC (USB 3.1 controller) whole.
I think this seems to be a bug.

Fo the moment I did this -

1. Create a script file wherever you wish. Ex: `~/Scripts/disable-
devices-as-wakeup.sh`.

```bash
#!/bin/bash

declare -a devices=("XHC") # <-- Add your entries here
for device in "${devices[@]}"; do
        if grep -qw ^$device.*enabled /proc/acpi/wakeup; then
                sudo sh -c "echo $device > /proc/acpi/wakeup"
        fi
done
```

2. Test it by executing it from the terminal.

3. If everything is okay then let's make a service.

`touch ~/Scripts/disable-devices-as-wakeup.service`

`chmod u+x ~/Scripts/disable-devices-as-wakeup.service`

~/Scripts/disable-devices-as-wakeup.service -

```bash
[Unit]
Description=Disable devices as wakeup

[Service]
ExecStart=/home/username/Scripts/disable-devices-as-wakeup.sh
Type=oneshot

[Install]
WantedBy=multi-user.target
```

4. Copy paste or move the service to `/etc/systemd/system/`.

`sudo cp ~/Scripts/disable-devices-as-wakeup.service
/etc/systemd/system/`

5. Enable the service.

`systemctl enable disable-devices-as-wakeup.service`

6. Restart the OS and check the status.

`systemctl status disable-devices-as-wakeup.service`

Detailed explanation found on https://access.redhat.com/documentation
/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-
managing_services_with_systemd

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1915264

Title:
  ALS (Ambient Light Sensor) wakes up the suspended Ubuntu

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1915264/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to