Skip to main content

List restartable programs or services using deleted libraries after upgrades

Project description


List running processes using files deleted by recent upgrades

Build Status

When upgrading packages, the package manager won't restart services or programs that depend on some updated library, for obvious reasons. This has security implications in the case of outdated libraries still in use.

OpenSUSE has a cool zypper ps command to check for programs and services using deleted files. It's also available in other distros as zypp-CheckAccessDeleted from the libzypp package. Those commands parse lsof output and check /proc/<pid>/cgroup to extract the service names.

Here's a Python version that checks /proc/<pid>/maps, extracting information from other files in /proc/<pid>.

No lsof dependency needed.

Excerpt from zypper manual:

After each upgrade or removal of packages, there may be running processes on the system which continue to use meanwhile deleted files. zypper ps lists all processes using deleted files, together with the corresponding files, and a service name hint, in case it’s a known service. This gives a hint which services may need to be restarted after an update. Usually programs which continue to use deleted shared libraries. The list contains the following information:

PID ID of the process
PPID ID of the parent process
UID ID of the user running the process
Login Login name of the user running the process
Command Command used to execute the process
Service Service name, if command is associated with a system service
Files The list of the deleted files


sudo pip3 install restartable


sudo restartable [OPTIONS]

List running processes using files deleted by recent upgrades

    -P, --proc PROC_DIRECTORY
	Specify /proc directory
    -s, --short
	Create a short table not showing the deleted files. Given twice,
	show only processes which are associated with a system service.
	Given three times, list the associated system service names only.
    -v, --verbose
        Show the complete command line


  • Verified to work on Python 3.5+
  • You must run it as root to see the information you want.
  • The output is different from zypper ps to be easily parseable


  • The service names can only be extracted if started by Systemd

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restartable-0.9.0.tar.gz (13.3 kB view hashes)

Uploaded source

Built Distribution

restartable-0.9.0-py3-none-any.whl (13.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page