3

I am using Xubuntu 14.10 on a 3rd Gen Lenovo Carbon X1.

A few days ago I noticed that my laptop was turning on by itself. I checked /proc/driver/rtc and saw that a wakealarm was set. So I did echo 0 > /sys/class/rtc/rtc0/wakealarm as root, and that stopped it from waking up by itself for a few days. However, it started turning itself on again, I checked and another wake alarm was set.

Is there any way to tell what is setting the wake alarm and is there anyway to display it?

Below is the output from /proc/driver/rtc

 rtc_time: 20:06:04
 rtc_date: 2015-04-20
 alrm_time: 11:54:00
 alrm_date: 2015-04-21
 alarm_IRQ: yes
 alrm_pending: no
 update IRQ enabled: no
 periodic IRQ enabled: no
 periodic IRQ frequency: 1024
 max user IRQ frequency: 64
 24hr: yes
 periodic_IRQ: no
 update_IRQ: no
 HPET_emulated: yes
 BCD: yes
 DST_enable: no
 periodic_freq: 1024
 batt_status: okay
A.B.
  • 89,123
  • 21
  • 245
  • 323
  • `sudo echo 0 > /sys/class/rtc/rtc0/wakealarm` gives me a `bash: /sys/class/rtc/rtc0/wakealarm: Permission denied` – A.B. Apr 21 '15 at 08:17
  • 1
    `sudo` doesn't work with `>`. Use `sudo -s`, then `echo 0 > /sys/class/rtc/rtc0/wakealarm` separately. – Mohammad Kholghi Oct 27 '21 at 07:23

1 Answers1

1

My first idea (but unfortunately that does not work):

sudo auditctl -w /sys/class/rtc/rtc0/wakealaram -p w -k rtc_access
sudo auditctl -w /proc/driver/rtc -p w -k rtc_access

The following isn't a specific solution, but a strategy:

  • The command to set the alarm time, looks like this.

    /usr/sbin/rtcwake
    
  • To find executable scripts that use this command:

    sudo find -L <your_script_folder> -executable -type f | xargs grep rtcwake
    

    But even in these directories it is worth a look:

    sudo find -L /usr/bin -executable -type f | xargs grep rtcwake
    sudo find -L /usr/local/bin -executable -type f | xargs grep rtcwake
    sudo find -L /opt -executable -type f | xargs grep rtcwake
    
  • You should also check your startup programs in:

    /etc/xdg/autostart
    ~/.config/autostart
    
  • Another place is in crontab

    sudo crontab -e
    crontab -e
    

    and in

    /etc/cron.* 
    
A.B.
  • 89,123
  • 21
  • 245
  • 323