New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schedule power down/up of the system #735
Comments
@schakrava A "Task type" profile to go along with the existing scrub and snapshot profiles could do a poweroff command at a configurable time. Users can always configure their BIOS to do timed power on with many systems these days until we get a proper UEFI interface option to do timed power-ups. |
Initial commit for custome scheduled tasks feature on Rockstor
Initial commit for custome scheduled tasks feature on Rockstor
Initial commit for custome scheduled tasks feature on Rockstor
Initial commit for custome scheduled tasks feature on Rockstor
Initial commit for custome scheduled tasks feature on Rockstor
Initial commit for custome scheduled tasks feature on Rockstor
Noting @MFlyer supplied link to acpi / RTC info for scheduled wake-up from the following forum thread: Linking back to related issue #1036 which also has some info on ACPI / RTC wake up programming. |
Some good reference too: |
Having code on this like a separate/test/base PR for #1036 |
Cross ref to #1306 |
@schakrava @phillxnet
Mirko |
Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 and rockstor#1306 - reboot and shutdown funcs already used when performing those action via WebUI. Scheduled reboots/shutdowns will have a 2 min delay (shutdown now is instead 1 min) to allow users to stop system shutdown too Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 and rockstor#1306 - Url Dispatcher updated to handle new reboot/shutdown delay param, same done over commands view Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 - Adding rtc wake up hour and minute fields to shutdown template plus auto toggle on rtc wake up checkbox Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Asking @rockstor/developers, @schakrava and users (@maxhq , @magicalyak, @daniel-illi, @sfranzen, @chrstphrchvz, @PhilippeAB, @tomtom13 and others) feedbacks: Can you shell check this? On my dev env got an S4 support, so no available rtc wake up after system shutdown, but wake up from suspend wyth |
@MFlyer OK, on my ASUS N3700-ITX board I get:
From memory isn't S4 essentially off anyway, S3 is regular suspend. I.e when bios set to have WOL doesn't that mean that off is S4 level and no deeper. Also from a NUC I have I get the following:
And this device wakes itself every morning via bios settings after shutting itself down via the following cron job every night:
Does that help? |
Thanks for your feedback @phillxnet , Can you test system wake up on that ASUS with:
On a working motherboard this will provide system wake up from power off after 5 mins |
Having some tests with built-in rtcwake tool (shutdown/suspend + wake after 120 sec):
S1 (standby) not available on my env To @phillxnet : you can try Finally I still have working wakeup only on suspend to RAM |
Hi @MFlyer, on my HP ProLiant MicroServer Gen8 I get:
|
Hi @maxhq , Mirko |
Nothing on journalctl (it's pretty busy) but dmesg | grep rtc I'm not in a position shutdown/suspend and restart at the moment. My server is up 24/7 (it also runs DNS for me) Server type: |
Refs to rockstor#735 rockstor#1306 and rockstor#1036 - Adding new suspend task on backend model and view plus smart_manager migration patching Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036: If task is suspend, aka system suspend to RAM, we force users to have a wake up! Adding suspend too because probably many system won't support full power off + wake, while suspend works Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 and rockstor#1306 - Url Dispatcher updated to handle new reboot/shutdown delay param, same done over commands view Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 - Adding rtc wake up hour and minute fields to shutdown template plus auto toggle on rtc wake up checkbox Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 and rockstor#1036 - Adding new suspend task on backend model and view plus smart_manager migration patching Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036: If task is suspend, aka system suspend to RAM, we force users to have a wake up! Adding suspend too because probably many system won't support full power off + wake, while suspend works Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 Delay param for reboot and shutdown no more required, checking if scheduled task via request.auth (none if command from WebUI, token if over APIWrapper by scheduled task). When shutdown and reboot come from a scheduled task we grant a 3 minute grace period to cancel it New rtcepoch param used to pass desired system wakeup epoch for shutdown and suspend Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 Added new handler for suspend task, served by same script. Wakeup need rtc hour/minute int to compute if task will be this day or next day, data conversion here to avoid it over cron script, so we convert from string to int only on db saving. Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 APIWrapper no more sending delay, using instead epoch wakeup time if present (delay checks moved to command view with token/not token req check) On shutdown and suspend tasks we check if wakeup option is on and parse cron time vs wakeup time to find if wake is on same day or next day Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 system_shutdown and system_reboot run with a delta, default to now when running from user input from WebUi and 3 mins when called via scheduled tasks Added system_suspend function just running a systemctl suspend Added wakeup functions set_system_rtc_wake and clean_system_rtc_wake: set_system_rtc_wake is our core function to set system wakeup, writing to default rtc0 wakealarm user wakeup time in epoch format, after flushing every wakeup value with clean_system_rtc_wake (write 0 to clean every time or we raise a resurce busy err) IMPORTANT: epoch can't be passed as a string, needed int -> write('%s' % epoch) fails Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - Added new else statement over tasks list page to handle common tasks like shutdown, suspend and reboot Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - Added new wakeup, rtc_hour and rtc_minute fields to backbone properties for Task object Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - Cleaned template structure Before this commit we had a page with 2 templates (main template and optional-fields template), "child" optional-fields template was used only when creating new tasks, tasks edit had a messy if else group on main template -> Moved all to optional-fields rendering on edit too Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 Scheduling task has a complete new view handling tasks edit over optional-fields template instead of main template Added some helpers (jquery helpers and Handlebars Helpers) for new shutdown/suspend/reboot tasks plus Handlebars Partials to have global vars to make taskObj available to main template and optional-fields template to. @schakrava check inline comments for more infos ;) Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs rockstor#735 rockstor#1306 rockstor#1036 - Flake8 for some files Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs rockstor#735 rockstor#1306 rockstor#1036 Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - Added user warning to check/test RTC WAKEUP capabilities before setting a shutdown/suspend task Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs rockstor#735 rockstor#1306 rockstor#1036 - Added ad hoc div to alert user about scheduled shutdown/reboot task Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - Added systemd-shutdownd service to available services for monitoring. Service turns on (rc=0) when a system shutdown/reboot scheduled, turns off (rc=3) if no shutdowns scheduled Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Refs to rockstor#735 rockstor#1306 rockstor#1036 - frontend/backend adds to control pending shutdown/reboot tasks. data_collector checks every 30 secs if we have a pending shutdown (if scheduled returns shutdown message with time infos too) On fronted we alert user with a message over Rockstor navbar Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
Hi @schakrava , like on #1306 i missed Fixes statement on commits. |
After Yum updates back on this: new job on May 🎉 , new nephew (welcome Zeno!!!), new cool issue 😃 Mirko |
Starting up again with a fresh new branch from last rockstor core updates |
You're right @phillxnet , already told it to @schakrava on previous message :) |
Thank you @MFlyer ! Sorry this got missed. |
feature request from the forum thread: http://forum.rockstor.com/t/features-i-would-like-in-rockstor/210
relevant section:
You can also power the NAS down and up again on a schedule, but I'm not sure this could be implemented on RockStor, due to lack of control over how to power the sytem up again.
The text was updated successfully, but these errors were encountered: