Skip to main content

Orchestration tool for managing systemd services and process priorities in Debian systems.

Project description

BoxManager

Python Package PyPI version

BoxManager is a lightweight Python library for orchestrating systemd services and adjusting process priorities on Debian-based systems. Perfect for embedded systems, robotics, or any scenario where performance context switching is essential.

Features

  • ✅ Suspend/resume systemd services
  • ✅ Deprioritize or prioritize running processes by keyword
  • ✅ Automatically restore system state after execution
  • ✅ YAML or JSON config support
  • ✅ Decorator or imperative-style usage
  • ✅ CLI for direct service and process control

Installation

pip install box-manager

Or if developing locally:

git clone https://github.com/yourusername/box-manager.git
cd box-manager
pip install -e .

Usage

Basic Example

from box_manager import BoxManager

manager = BoxManager()

@manager.with_orchestration(
    stop_services=["nginx"],
    deprioritize=["chrome"]
)
def critical_task():
    print("Doing performance-critical work...")

critical_task()

Using Config File

# config.yaml
orchestration:
  stop_services:
    - nginx
  start_services:
    - my_custom_service
  deprioritize:
    - chrome
  prioritize:
    - ros_node
manager.load_config_and_orchestrate("config.yaml", func=my_task)

CLI

Use the command line interface to quickly control services:

box-manager start nginx
box-manager stop nginx
box-manager status nginx
box-manager restart nginx

Available Commands

  • start <service>: Start a systemd service
  • stop <service>: Stop a systemd service
  • status <service>: Check if a service is active
  • restart <service>: Restart a systemd service

License

MIT License


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


Author

Made with ☕ by Rajat

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

box_manager-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

box_manager-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file box_manager-0.1.1.tar.gz.

File metadata

  • Download URL: box_manager-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for box_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3aa337b7018c020813b58eb241dfbb11559fe32f4c3a87565060bf309d39e82
MD5 ad78900469524f4468699059ee8d831b
BLAKE2b-256 7330f92a489e77bda491cef2078eab1bc32dc36db28b5c9711f3bb955bf26234

See more details on using hashes here.

Provenance

The following attestation bundles were made for box_manager-0.1.1.tar.gz:

Publisher: python-publish.yml on rajatasusual/box-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file box_manager-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: box_manager-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for box_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7049d216775f90e2ccf4a50d8551527b2edb55de881f40f9d528c0f964701b
MD5 c7a1f25e099058003983b89a67f04d3b
BLAKE2b-256 07aa468bb4c65c83737174163cb6c10277cad7ee2048f1a002313c121eadeb26

See more details on using hashes here.

Provenance

The following attestation bundles were made for box_manager-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on rajatasusual/box-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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