OPNsense Forum

Archive => 17.1 Legacy Series => Topic started by: mr.rosh on February 08, 2017, 07:40:02 am

Title: [SOLVED] Scheduled Reboot
Post by: mr.rosh on February 08, 2017, 07:40:02 am
I see under maintenance, that there ar 2 options, reboot and power off.

is there any chance to have a scheduler to perform reboots as various times.

practical reason is i have an old white box running opnsense, and it packs up.
Title: Re: Scheduled Reboot
Post by: Oxygen61 on February 08, 2017, 08:32:43 am
hey hey,

you can use a Cron Job for that. Sadly there is no action configured to reboot the system.
I wrote a tutorial on how to send backup files on a TFTP Server which works exactly like the way you want your server to reboot.

The obvious problem here is: It's in german.. lol  ;D
Maybe u can still get something out of it: https://forum.opnsense.org/index.php?topic=3853.0
Basically what u need to do is:

1.) Write a shell script which would reboot the system
2.) Create a new "action.conf" in "actions.d"
2.a) The new action needs some input like this:

[start]
command:/directory/your_new_script.sh start
parameters:<keep this empty>
type:script
message:<some message to know whats happening>
description:<some description to know whats happening>

3.) Restart the config Daemon by using this: service configd restart
4.) Now go to your Cron Tab in the WebGUI: https://<LAN-WEBGUI-IP>/ui/cron/
5.) choose a time when to start the script -> Apply

Thats it. :)

Have fun and hopefully it works :)

Best regards
Oxy
Title: Re: Scheduled Reboot
Post by: Taomyn on February 08, 2017, 08:39:51 am
Yes, I too would like to see this built-in - my regular complete hang since upgrading to 17.1 would be more bearable if I could reboot the firewall each day. At least until a fix is released.
Title: Re: Scheduled Reboot
Post by: mr.rosh on February 08, 2017, 09:31:04 am
I'm in the favor that this should be available, without the need to do any manual cron jobs.

This was, every think is from within the gui [even though it run scripts in background]

perhaps there should be a forum, where we put in requests of what features we'd like to have.

Title: Re: Scheduled Reboot
Post by: Oxygen61 on February 08, 2017, 09:52:47 am
Here is your "Forum" to ask for any Feature Requests: https://github.com/opnsense/core/issues
My Idea of using a cron job+Script was just a workaround. ;)

Best regards
Oxy
Title: Re: Scheduled Reboot
Post by: franco on February 08, 2017, 12:21:14 pm
Sure, we can add this, I'll look into it.

Edit: permanent ticket https://github.com/opnsense/core/issues/1387
Title: Re: Scheduled Reboot
Post by: franco on February 08, 2017, 06:43:41 pm
Done: https://github.com/opnsense/core/commit/a0689d4f

Does not ship with 17.1.1 tomorrow as it is already done, so make sure to either reapply or wait for 17.1.1 to apply:

# opnsense-patch a0689d4f


Cheers,
Franco
Title: Re: Scheduled Reboot
Post by: Taomyn on February 08, 2017, 08:19:24 pm
Done: https://github.com/opnsense/core/commit/a0689d4f

Quality service, thanks Franco