Skip to main content

A tool to detect and correct common issues around RPM database corruption.

Project description

dcrpm

Continuous Integration Code style: black

dcrpm ("detect and correct rpm") is a tool to detect and correct common issues around RPM database corruption. It attempts a query against your RPM database and runs db4's db_recover if it's hung or otherwise seems broken. It then kills any jobs which had the RPM db open previously since they will be stuck in infinite loops within libdb and can't recover cleanly.

Usage

Run dcrpm with no option to detect and correct any outstanding issues with RPM on your host. Additional options can be used to customize logging or select specific remediations. dcrpm is meant to be run from cron regularly to keep things happy and healthy.

Requirements

dcrpm requires Python 2.7 and above and the package psutil. It also requires lsof to be in $PATH. It should work on any Linux distribution with RPM and on Mac OS X.

To use setup.py you need setuptools >= 40.9.0 (see setup.cfg-only projects). Substitute legacy_setup.py if you have an older setuptools (e.g. when building on EL 8).

Installing dcrpm

dcrpm is packaged in Fedora as of Fedora 32 and in EPEL as of EPEL 8. It can be installed with:

dnf install dcrpm

This will also install any necessary dependencies at the same time.

Building and installing dcrpm from source

The easiest way to manually install dcrpm is get the source and install it using setup.py:

python setup.py install

This will fetch psutil from PyPI for you. dcrpm also assumes that the system will have RPM and Yum or DNF installed.

Building and installing for development

If you want to develop, the easiest way to get dcrpm is by using pip:

pip install -r requirements-test.txt # get extra packages
python setup.py install

When developing it's important to make sure the tests continue to pass, and to ensure new features have the appropriate test coverage. You can run the test suite with:

pytest

Preparing a new release

First, install some extra packages:

pip install -r requirements-release.txt

Then create the source distribution and the wheel:

Old style

python setup.py sdist bdist_wheel --universal

With the build module

This has the advantage of performing the build in an isolated virtual environment. However, it does not build a universal (py2/py3) wheel anymore.

python -m build

Then verify them:

twine check dist/*

A Makefile is provided to simplify this

make dist
make dist USE_BUILD=1  # use the build module, soon to be default
make dist USE_LEGACY=1 # use legacy_setup.py
make check-release

Contribute

See the CONTRIBUTING file for how to help out.

License

dcrpm is GPLv2-licensed.

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

dcrpm-0.6.3.tar.gz (69.7 MB view details)

Uploaded Source

Built Distribution

dcrpm-0.6.3-py2.py3-none-any.whl (28.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dcrpm-0.6.3.tar.gz.

File metadata

  • Download URL: dcrpm-0.6.3.tar.gz
  • Upload date:
  • Size: 69.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for dcrpm-0.6.3.tar.gz
Algorithm Hash digest
SHA256 65c99becf6a0ee0fc7b879faf7a1a624a0615473b3a225e455c297f459b9115a
MD5 11c29bf02ff437d3364a73e823e9a5fe
BLAKE2b-256 1d49d571755853f555b121c47c766281f8410f9708e978d6a9ada82aa279a0ad

See more details on using hashes here.

File details

Details for the file dcrpm-0.6.3-py2.py3-none-any.whl.

File metadata

  • Download URL: dcrpm-0.6.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for dcrpm-0.6.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b2148471f05273f85fe6576410ba5c30b8b9d73ef480b34dafe6f6dae09af21d
MD5 ffadd1ab5d883a3fd9c01862a95158a2
BLAKE2b-256 08c0ac5bc9c6d3fa953eef6f63dfb71bef806c6adbe384705ba5f15319129303

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page