core
core copied to clipboard
Removal of a cron job command during a firmware update enables automatic firmware updates
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- [X] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- [X] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
Describe the bug
It seems that if a cron job command (f.e. "Update HAProxy OCSP data") gets removed during a firmware update of OPNsense the system changes the command of that cron job automatically to the first one in the list, which is "Automatic firmware update".
I imagine this can be really bad for some people if an update fails for whatever reason.
To Reproduce
Steps to reproduce the behavior:
- Install an OPNsense version prior to v24.1, f.e. 23.7.x
- Manually create a cron job with "Update HAProxy OCSP data" as the command.
- Update OPNsense to v24.x.
- The created cron job will now have the "Automatic firmware update" command set on it.
Expected behavior
In such a case it would be much better if that cron job got disabled during the firmware update.
Describe alternatives you considered
An alternative would be to delete the cron job during the firmware update.
Additional context https://forum.opnsense.org/index.php?topic=23339.msg188879#msg188879
Picture for reference:
It won't write that value as the configuration still contains the old one, editing however will show the first item in the list.... option lists are only able to show the options in them.
Makes sense, thank you for the clarification.
I think it could still make sense to modify the update process as follows:
- disable the cron job
- keep the original job description but insert something like "DEPRECATED - " at the beginning.
example old description: Update HAProxy OCSP data new description: DEPRECATED - Update HAProxy OCSP data
This should avoid confusion for other users.
That would be the responsibility of the plugin in question.... (I expect a configd command was changed in this case, the description shouldn't be very important as the key is the command)
Understand, but what about commands that are unrelated to HAProxy or other plugins. For them the "issue" would be the same: If they get removed during an update of OPNsense they are still shown as active in the list of cron jobs and could potentially confuse users.
Thanks to you I now know that this is not a big deal since the command isn't able to run anymore, but still handling those situations could be improved.
We have written migrations for those in the past already to avoid such bug reports. 😊
This issue has been automatically timed-out (after 180 days of inactivity).
For more information about the policies for this repository, please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.
If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.