Fortunately, DNF will tell you if a restart is really needed. And which packages need the restart, too.
dnf needs-restarting will report packages that need a restart to be fully applied and `echo $?` is 1 when a restart is needed and 0 when it is not (for your automation and scripting use).
