Udo G
Udo G

Reputation: 13121

power cycle via ACPI?

Is it possible to do a real powercycle using ACPI or other software command?

A normal software reboot isn't enough in my case as apparently that doesn't reset some periphery (USB Modem, a blocked SSD controller).

Upvotes: 0

Views: 1479

Answers (1)

Udo G
Udo G

Reputation: 13121

I found another, rather simple solution that does the same without special ACPI calls. Most computers have a RTC clock inside which usually supports a "RTC alarm", that will wakeup the computer at a specified time.

The following command will halt the computer and reboot it after 30 seconds:

echo `date '+%s' -d '+ 30 seconds'` > /sys/class/rtc/rtc0/wakealarm \
    && halt

or an alternative without clean shutdown (it immediately powers down the computer, risking file system corruption):

echo `date '+%s' -d '+ 30 seconds'` > /sys/class/rtc/rtc0/wakealarm \
    && sleep 2 \
    && echo o >/proc/sysrq-trigger

Hope this is useful to someone..

Note: To reset the RTC alarm on powerup, use echo 0 > /sys/class/rtc/rtc0/wakealarm

Upvotes: 2

Related Questions