https://github.com/rajatasusual/box-manager
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.
https://github.com/rajatasusual/box-manager
debian kernel-module linux orchestration system-services
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/rajatasusual/box-manager
- Owner: rajatasusual
- Created: 2025-04-11T22:45:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-14T16:44:58.000Z (about 1 year ago)
- Last Synced: 2026-01-04T02:05:29.016Z (5 months ago)
- Topics: debian, kernel-module, linux, orchestration, system-services
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BoxManager
[](https://github.com/rajatasusual/box-manager/actions/workflows/python-publish.yml)
[](https://pypi.org/project/box-manager/)
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
```bash
pip install box-manager
```
Or if developing locally:
```bash
git clone https://github.com/yourusername/box-manager.git
cd box-manager
pip install -e .
```
---
## Usage
### Basic Example
```python
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
```yaml
# config.yaml
orchestration:
stop_services:
- nginx
start_services:
- my_custom_service
deprioritize:
- chrome
prioritize:
- ros_node
```
```python
manager.load_config_and_orchestrate("config.yaml", func=my_task)
```
---
## CLI
Use the command line interface to quickly control services:
```bash
box-manager start nginx
box-manager stop nginx
box-manager status nginx
box-manager restart nginx
```
### Available Commands
- `start `: Start a systemd service
- `stop `: Stop a systemd service
- `status `: Check if a service is active
- `restart `: 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](mailto:rajatasusual@github.com)