SOLVED RTC on FreeBSD? Solved via timed socket and "restore after power loss"

dffvb

Dabbler
Joined
Apr 14, 2021
Messages
42
Hi there on SCALE I use:

"sudo rtcwake -m no -s 27000 && sudo shutdown" with a cron job to shut down at night, is there an aquivalent on CORE?

Thanks in advance
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Could you explain to us mere BSD folk what that command does? Of course you can power down from cron. Powering up is a different challenge ...
 

dffvb

Dabbler
Joined
Apr 14, 2021
Messages
42
The command shuts down the box, waits 27000 seconds and than powers it up gain - the RTC wake in the BIOS is a pain, and I found this command to work quite fine with SCALE - so what I am looking for is, to power it up again at a given time (every day 8 o'clock)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
How does it do that? Is this BIOS RTC support special or rather ubiquitous? Honestly never heard of that. I was only aware of WoL.

Looks like it's an open TODO on FreeBSD:

A practical workaround:
- set BIOS to "state after power failure: ON"
- shutdown at e.g. 11pm
- put on an AC timer that powers off at 11:30 and powers on at 8am again
 
Last edited:

dffvb

Dabbler
Joined
Apr 14, 2021
Messages
42
Good question - I had my BIOS set to wake RTC, and it did this under windows just fine. With SCALE it didnt want to start, probably because the cron job with poweroff was "final", halt command left the display on, so not too convincing, after some googling I found the above command and changed the bios from "wake RTC" to "OS controlled" and it worked just fine since, then. Tried the same for core, but no success. Maybe I could try a command under core which allows RTC wake ... ?
 

dffvb

Dabbler
Joined
Apr 14, 2021
Messages
42
So since Wake on LAN / RTC are different on each motherboard, and also party depend on S states, I came across another: restore after power loss.

You do need a timed socket - I have one anyway turning off the router at night. So the TrueNAS mchines dhuts down via cronjob, later the power socket turns off, and in the next mornign it power the box on again. Lets see if this affects battery life of the motherboad battery, but it works for me
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
That's exactly what I suggested above
 
Top