Skip to main content

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

Project description

BoxManager

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.0.tar.gz (4.3 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.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: box_manager-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 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.0.tar.gz
Algorithm Hash digest
SHA256 7ef66714e22f87b6d69b0361dd3d2497b0141ca8126055e28a104f88df77785c
MD5 2167fd75e4fc216237b0d98d35871870
BLAKE2b-256 bd2680ef6494121cbcc052b56ac24a97e05af9c911f7a00f57143c119236ee08

See more details on using hashes here.

Provenance

The following attestation bundles were made for box_manager-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: box_manager-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd6b44d52b95955204c9fbf586e857283c8f2f071bebca02f14671d56f6bec9
MD5 dd377e8def468cbb06f28fbfd6046551
BLAKE2b-256 61e98d152e6ea91a0c83cdb9c4c463b984b3751d4626dde9b7d461132156379e

See more details on using hashes here.

Provenance

The following attestation bundles were made for box_manager-0.1.0-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