OPNsense Forum

English Forums => General Discussion => Topic started by: aynar on January 18, 2018, 05:00:33 pm

Title: How to keep changes in opnsense files after reboot?
Post by: aynar on January 18, 2018, 05:00:33 pm
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.
Title: Re: How to keep changes in opnsense files after reboot?
Post by: fabian on January 18, 2018, 05:05:14 pm
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.
Title: Re: How to keep changes in opnsense files after reboot?
Post by: franco on January 18, 2018, 06:02:06 pm
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
Title: Re: How to keep changes in opnsense files after reboot?
Post by: aynar on January 19, 2018, 01:05:49 pm
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
Title: Re: How to keep changes in opnsense files after reboot?
Post by: fabian on January 20, 2018, 11:36:04 am
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.