Problem description
The dnf needs-restarting command reports that some services need a restart even if they were already restarted in the package %post script.
The reason is that needs-restarting compares the package installtime with the service process boot_time. If installtime > boot_time, the service is marked as outdated. However, in cases where the %post script explicitly starts or restarts the service, the process boot_time is still older than the installtime, which causes a false positive.
Relevant code snippet (from needs-restarting.py):
if self.opts.reboothint:
need_reboot = set()
installed = self.base.sack.query().installed()
for pkg in installed.filter(provides=NEED_REBOOT):
if pkg.installtime > process_start.boot_time:
need_reboot.add(pkg.name)