After aptitude or similar upgrade tool completes its job, new versions of files are installed into filesystem. However, some running processes may be still using old files (and actually Linux file systems continue to store invisible copies of old files while those are mapped by running processes).
In case of a security update, having old versions running keeps system vulnerable even after update completes, which is not good. A reboot is possible, but that’s an ugly solution.
Fortunately tools exist to find processes that have deleted files mapped. One of these tools is checkrestart (from debian-goodies package).
Just run checkrestart -p after upgrade, and you will see what to restart to be safe – and even what init.d scripts to run with restart argument.
P.S.
On a server with hundreds of running processes, checkrestart -p is terribly slow, likely because it makes separate queries to dpkg about files mapped by each process. Perhaps it could be seriously accelerated if first all names to query are gathered, and then each name is queried only once. Any volunteers to do that?
English