DNF-Automatic - command emitter and reboot command

Dear community

I successfully set up DNF-Automatic on a Rocky 9 server, to fully automate security updates. It gives me peace of mind and does what it should.

I have two “problems” still unsolved and I’m looking for help:

  1. How can I get the custom reboot command to work?
    I want the command to execute a particular script, just before rebooting. This script will notify me, that a reboot has happened.

Here are the commands I used now, but it did not work:

"/usr/local/scripts/notify-reboot-after-update.sh '⚠️ System has been rebooted\\. Please act\\.'; shutdown -r +5 'Rebooting after applying package updates'"
"/usr/local/scripts/notify-reboot-after-update.sh '⚠️ System has been rebooted\\. Please act\\.' && shutdown -r +5 'Rebooting after applying package updates'"
  1. How do I get the “command” emitter to work?

I really spent a lot of time and effort to try figuring out how this works. None of my actions helped.
Using the command emitter, I tried to also call a custom script and pass it the results of the DNF-Automatic activity. It should warn me about potential issues and when DNF-Automatic failed.

I also tried to use an easier approach and just save the output from DNF-Automatic to a file, using simple command as “cat”, “tee” or even “touch” (to see if a file is even being created).

I have seen people getting email emitters to work. The output from DNF-Automatic looks like a table, which gives out a good summary. However, the only place I see feedback from DNF-Automatic is in the journal.

Looking forward to any help. I’m also very open to suggestions/hints, if anyone has a better idea on how to successfully and reliably do automated security patching.

BR
Gabriel

1 Like