DNF4-NEEDS-RESTARTING(8)

πŸ’– DNF4-NEEDS-RESTARTING πŸ’–

okay bestie so this is a page from the dnf-plugins-core manual, section 8 (that's the "admin commands" section, iykyk). It's giving "your laptop has been up for 47 days and something is stale" energy, and honestly? Iconic. Settle in. 🫢


✨ NAME ✨

dnf4-needs-restarting β€” the DNF needs_restarting plugin.

It checks for running processes that should be restarted. That's the whole vibe. Periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

dnf needs-restarting [-u] [-r] [-s]

🌸 DESCRIPTION 🌸

So needs-restarting goes through all your running processes and tries to sniff out the ones that are using files from packages that got updated after the process started. Those lucky little guys get reported by this tool. Slay. πŸ’…

ngl, most of the time a process is totally fine surviving an update to its binary and the libraries it's using β€” it doesn't need a restart to keep working properly. But there are specific cases where that does not apply, and also, separately, processes often need restarting just to reflect security updates. So like... vibe check your processes. πŸ”₯

Note: Needs-restarting will try to guess the boot time using three different methods:
  • UnitsLoadStartTimestamp β€” a D-Bus property on /org/freedesktop/systemd1. Works unless the system was not booted with systemd, such as in (most) containers. πŸ™ˆ
  • st_mtime of /proc/1 β€” reflects the time the first process was run after booting. This works for all known cases except machines without a RTC β€” they awake at the start of the epoch. πŸ’€
  • /proc/uptime β€” the seconds field of /proc/uptime subtracted from the current time. Works for machines without RTC if the current time is reasonably correct. Does not work on containers which share their kernel with the host β€” there, the host kernel uptime is returned. 😭
Warning: Some systems are configured to read the RTC time in the local time zone. This mode cannot be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling timedatectl set-local-rtc 0. See man timedatectl for more information. πŸŽ€

✨ OPTIONS ✨

All general DNF options are accepted, see Options in dnf(8) for details. Bestie, the generic ones are all there, don't worry.

  • -u, --useronly β€” only consider processes belonging to the running user. just yours, nobody else's business 🫢
  • -r, --reboothint β€” only report whether a reboot is required (exit code 1) or not (exit code 0). A simple yes/no, king behavior πŸ‘‘
  • -s, --services β€” only list the affected systemd services. services only, no stray processes, we're being picky πŸ’…
  • --exclude-services β€” don't list stale processes that correspond to a systemd service. bye bestie πŸ‘‹

🌈 CONFIGURATION 🌈

The config directory lives here:

/etc/dnf/plugins/needs-restarting.d/

And individual files look like:

/etc/dnf/plugins/needs-restarting.d/pkgname.conf

Packages can be added to needs-restarting via conf files in the config directory. Config files need to have the .conf extension or they will be ignored. (yes literally ignored, no warning, no nothing, so name your files right πŸ’€)

More than one package is allowed in each file (one package per line), although it is advised to use one file for each package. Lowkey cleaner that way, highkey recommended. ✨

Example:

echo "dwm" > /etc/dnf/plugins/needs-restarting.d/dwm.conf

πŸ’œ Author πŸ’œ

See AUTHORS in your Core DNF Plugins distribution. The whole squad, we don't know them individually, but we love them. 🫢


2014, Red Hat, Licensed under <rainbow>GPLv2+</rainbow>.


aaaand that's the page, bestie! this one's from dnf-plugins-core, version 4.10.1, dated Sep 27, 2025. go forth and check your stale processes, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from