I previously submitted a question regarding DNF-Automatic where it would fail if I put my computer to sleep and woke it at some point after DNF-Automatic was configured to run. You can see that thread here
I believe the issue was that DNF-Automatic would start virtually immediately after waking my computer but it took a second or two for my computer to get back online with an internet connection.
I added ExecStartPre=/bin/sleep 30 to the service file and that fixed this issue. DNF Automatic has been working flawlessly since then.
I checked today and DNF Automatic had failed to run. After seeing what updates were recently installed, sure enough it seems like DNF Automatic had been recently upgraded and my changes of adding ExecStartPre=/bin/sleep 30 were removed.
It would be nice if subsequent upgrades/versions of DNF Automatic could have a similar sleep command included in the service file to account for users who have their computers go to sleep. This way DNF Automatic would continue to work properly even when it updates again
Based on your previous post, I assume you mean you edited the file from the package (i.e., something in /usr/), which will of course be overwritten every time you update the package.
If you want to create an override, there are other directories that are not touched by packages and overlay the existing unit files. There’s no need to guess where they are; you can use systemctl to add an override:
Thanks for the suggestion. When I enter: sudo systemctl edit dnf-automatic-install.service, I’m just presented with an empty file though. Am I missing something/misunderstanding or is this to be expected?
You do need [Service] because that’s the section in which ExecStartPre belongs. Overrides are not concatenated together textually, but are merged together, section-by-section, key-by-key. See Example 2 here.