OPNsense Forum

English Forums => General Discussion => Topic started by: gromit on November 10, 2022, 05:09:05 pm

Title: Periodic.conf tunables?
Post by: gromit on November 10, 2022, 05:09:05 pm
The official OPNsense documentation about tunables (https://docs.opnsense.org/manual/settingsmenu.html) says they are for loader.conf and sysctl.conf tunables. I have a ZFS setup on which I would like to enable a periodic scrub. FreeBSD has a built-in /etc/periodic/daily/800.scrub-zfs task that is disabled by default. I'd like to enable this via the daily_scrub_zfs_enable setting.

Assuming this can't be added as a tunable to the "System: Settings: Tunables" section, the normal way in FreeBSD would be to add it to /etc/periodic.conf or /etc/periodic.conf.local. Will the latter persist across updates?

(Are there any plans to add periodic settings to "System: Settings: Tunables"?)
Title: Re: Periodic.conf tunables?
Post by: franco on November 10, 2022, 05:35:54 pm
It looks like either /etc/periodic.conf or /etc/periodic.conf.local will persist on updates as long as FreeBSD will not add them to the base system by default (the .local is probably the safest). We don't write any of these files.

The tunables GUI will likely not gain periodic.conf support though. sysctl.conf and loader.conf are a bit intermingled in the grand scheme of things, but periodic.conf is something else.


Cheers,
Franco
Title: Re: Periodic.conf tunables?
Post by: gromit on November 19, 2022, 05:30:04 am
Thank you.  I added the setting to /etc/periodic.conf.local.  I just updated to 22.7.8 and the file persisted across that update.
Title: Re: Periodic.conf tunables?
Post by: abulafia on November 24, 2022, 12:04:09 pm
Thank you both - I'll set up a .local on my system too to enable trim, scrub and snapshots.
Title: Re: Periodic.conf tunables?
Post by: dcol on December 21, 2022, 05:18:57 pm
Can we get some more details on how to add this feature? I do not have the file /etc/periodic.conf.local in my system. Using SSD for my ZFS without a mirror is risky without these tools.
Thanks
Title: Re: Periodic.conf tunables?
Post by: cookiemonster on December 21, 2022, 11:08:35 pm
It's a file that needs to be created unless modifying the default .conf file /etc/defaults/periodic.conf
Just create the file and enable the option you want. Change from "NO" to "YES".
Title: Re: Periodic.conf tunables?
Post by: dcol on December 21, 2022, 11:35:49 pm
So I can just make the change 'daily_scrub_zfs_enable="YES"' in /etc/defaults/periodic.conf

Or do I need to create periodic.conf file and put it in /etc/
Title: Re: Periodic.conf tunables?
Post by: dcol on December 21, 2022, 11:40:39 pm
I see now. Leave the default periodic.conf alone and put the overrides in the new file in /etc/
Title: Re: Periodic.conf tunables?
Post by: cookiemonster on December 22, 2022, 12:00:30 am
Yes. I would create a /etc/periodic.conf.local so it persists upgrades. That's probably what you were thinking of doing.
Title: Re: Periodic.conf tunables?
Post by: dcol on December 22, 2022, 12:11:23 am
Got it. Thanks for the help.