TIL about checkrestart(1) which can help figure out which processes need a restart after package upgrades.

@stchris I'm using a one-liner that tells me about all the processes, not just daemons. Also lists the files that are in use, so I can decide how critical it is to restart (e.g. re-reading FontConfig cache is not very important).

$ sudo lsof / | grep DEL | cut -f1 -d' ' | sort -u

@stchris Okay, this is embarrassing: people are favouriting and boosting this toot, but the command doesn't actually match the description >_< It only lists unique process names, without any files.

The correct one is:

$ sudo lsof +c 0 / | grep '\sDEL\s'

That one prints much more stuff, and I find it more useful.

@stchris cool find that! Looking into checkrestart led me to be able to say that TIL about needrestart, which does the same thing, but can prompt you after an apt upgrade.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.