How to keep changes in opnsense files after reboot?

Started by aynar, January 18, 2018, 05:00:33 PM

Previous topic - Next topic
hi everybody


I changed the access.log path in the squid.conf file and I added a line in crontab -e
but I lose the configuration once the machine is restarted
how can i keep my changes after reboot?


Thanks.

For the cron stuff: use a configd call and add it via the GUI.
Squid: use one of the plugin hooks. The configuration file is generated.

OPNsense tries very hard to keep a consistent configuration of itself during reconfigure, reboot and firmware updates as not doing so could affect operation in a negative way.

There are, however, plenty of plugin hooks for all sorts of requirements.

It's easer to tell exactly what you want to achieve instead of what you did, so we can help find the best solution.


Cheers,
Franco

thanks for the help
fabian I did not understand the proposed solution
i'll explain i just want to change the path accesslog in the squidconfig file to make lightsquid work
and crontab -e it is to run the lightparserpl automatically every 15min
and it works
except that I lose this config after rebooting
my goal is just to make lightsquid work

You need a configd config file and add lines like in the IDS:
https://github.com/opnsense/core/blob/master/src/opnsense/service/conf/actions.d/actions_ids.conf#L67-L72

Then you can schedule it via the GUI and it will survive a reboot (in addition it will be restored after a reinstall if you create the configd command again.

For squid: maybe it is easier to specify the path to the squid log file in the lightsquid call or you can solve it via a symbolic link. The path should not be changed because you will break the GUI log viewer.