AUTO POWER ON PROBLEM

Hi all…
I need my PC to auto turn on every day at 9:00 AM.
To make it auto turn on i’ve done the following:

  1. Enabled [Resume By Alarm] in BIOS and set alarm to 9:00
  2. Changed SYSTOHC to “no” in /etc/sysconfig/clock
  3. Edited my halt.local to run a special script before shutdown. The script contains:

echo 0 > /sys/class/rtc/rtc0/wakealarm
echo $time > /sys/class/rtc/rtc0/wakealarm

Not important how $time is calculated, i’ve tested it with cat /proc/driver/rtc and it looks right!

So after powering off my PC haven’t turned on by specified time…

Help me please!!! Whot am i doing wrong?
My SUSE is 11.0

Maybe a littke bit of help from your side may help me.

I do understand that you set the system to not update the hardware clock with the system time on shutdown (though I do not understand why not, setting the clock correct may only improve the ‘power on’ to happen on the correct time imho).

As my system has nothing in /sys/class/rtc/ (but I have openSUSE 10.3 and thus another kernel) I can not recreate what you did. But what is it supposed to do?

I can get the info from /proc/driver/rtc and there is an ‘alarm’ time there. Is that the one set by you in the BIOS? When yes, why do you try to set some time (what is the $time supposed to contain?) to /sys/class/rtc/rtc0/wakealarm?

>>>I do understand that you set the system to not update the hardware clock with the system time on shutdown.

That’s right! It’s necessary because if to allow system to update a clock it won’t power on by alarm. I can’t explain such behavior but it is so… Actually in some cases depending on hardware all will work fine but not in mine…

>>>As my system has nothing in /sys/class/rtc/ (but I have openSUSE 10.3 and thus another kernel) I can not recreate what you did. But what is it supposed to do?

Of course, for your kernel similiar actions have to be done with /proc/acpi/alarm.
It’s supossed to power on PC on shcedule some times a day, do some job then power off.

>>>I can get the info from /proc/driver/rtc and there is an ‘alarm’ time there. Is that the one set by you in the BIOS? When yes, why do you try to set some time (what is the $time supposed to contain?) to /sys/class/rtc/rtc0/wakealarm?

By default it is. But after touching /sys/class/rtc/rtc0/wakealarm these times are different. Setting wakealarm in OS doesn’t touch BIOS alarm but PC powers on sometimes (that’s another magic for me).
$time contains the next time at wich the PC must power on. It’s calculated every time OS loads according to scheldue.
/proc/driver/rtc and logging allowed me to make sure $time is allways correct so the problem is not in $time generating algorithm. Nevertheless, my system had successfully started several times, but most of times it hadn’t… And i can’t figure out why…

Thanks for the clarifications. They do help me, but this does not help you very much I am afraid.

As it is seems to be a ‘sometimes it works and sometimes it doesn’t’ problem, it won’t be easy to solve :frowning:

I’ve localized a problem.
halt.local runs after acpid stopped. So i’m setting wakealarm after the daemon that serves it is stopped…
Now i’m setting wakealarm at boot.local and it’s fine but it behaves a strange way…
Once i configured my boot.local, restarted, checked that it works ok and then powered off - it wakes and successfuly works only once… So when system loads a first time itself and after doing a job shuttding down, the wakealarm setting has no effect and system won’t boot itself…

If you’re interested i’ve started another topic and here is a link ACPID Question - openSUSE Forums