Enable auto reboot after system upgrade

Is there a config option to automatically reboot the system after a system upgrade?
There is a notice in the login message that the system requires a reboot after a kernel upgrade. I would like this to be automatically done after the upgrade.
Than you.

The problem is, auto-update could happen anytime. So automatically rebooting after it would almost certainly result in data loss, unless every program has the ability to save the unsaved data somehow.

This is not different from me manually running “reboot now”. But the question is if there is a such an option because right now, system upgrades sometimes cause services to stop (unexpectedly) and a manual intervention is necessary to recover them.

you can add a systemd service that runs after update, there is one example in the NVIDIA driver tutorial.

Thank you. I assume you are referring to this tutorial:

Yes, there’s only one part about the systemd service. you only need to change the command to something that reboots.