0

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).

Udo G
  • 12,572
  • 13
  • 56
  • 89

1 Answers1

2

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

Udo G
  • 12,572
  • 13
  • 56
  • 89