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.
- ✅ 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
pip install box-manager
Or if developing locally:
git clone https://github.com/yourusername/box-manager.git
cd box-manager
pip install -e .
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()
# 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)
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
start <service>
: Start a systemd servicestop <service>
: Stop a systemd servicestatus <service>
: Check if a service is activerestart <service>
: Restart a systemd service
MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Made with ☕ by Rajat