This question is similar to this one.
When installing package updates, it's easy to find out package dependencies with
apt-cache depends, however, I don't know how to find out what services may be affected. This is a significant problem in some circumstances; answers in that other question suggest that service restarts only take a few seconds, but that's not always true, for example a big MySQL instance may take several hours to shut down! Say there's an update to php5-curl. This is dependent on libapache2-mod-php5, which in turn depends on apache2-mpm-prefork. That package has 'apache2' on its provides list in
aptitude show, so that tells me it's related to that service, but not necessarily that it needs a restart. I suspect that package dependencies alone are not sufficient to resolve this - I can imagine similar dependency chains that do not require a service restart (for example if the service loads such externals dynamically).
When I do an
aptitude full-upgrade, I get nice output in "The following packages will be upgraded...". What I'm after would be a section in that output saying "The following services will be restarted...". How can I get that?