https://github.com/azersd/taskmaster
a Job Control System like Supervisord
https://github.com/azersd/taskmaster
Last synced: 12 months ago
JSON representation
a Job Control System like Supervisord
- Host: GitHub
- URL: https://github.com/azersd/taskmaster
- Owner: AzerSD
- License: mit
- Created: 2025-06-05T18:10:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-05T18:35:50.000Z (about 1 year ago)
- Last Synced: 2025-06-05T19:26:50.345Z (about 1 year ago)
- Language: C++
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฉ Taskmaster (C++ Job Control System)
## ๐ Project Description
**Taskmaster** is a job control system inspired by `supervisord`. It monitors and manages long-running processes based on a configuration file. It supports process control, automatic restarts, and a command-line interface for interacting with managed processes.
This project is implemented in **C++**, using only the **standard library** (with exceptions for parsing config files). It is designed to run in the foreground and not as a true daemon.
---
## โ
To-Do List
### ๐ง Core Functionality
- [x] Parse configuration file (YAML or custom format)
- [x] Launch processes based on configuration
- [ ] Monitor processes and track status (alive/dead)
- [ ] Implement auto-restart logic based on config
- [ ] Handle `SIGHUP` to reload configuration
- [ ] Hot-reload without affecting unchanged processes
- [ ] Implement process logging system (file-based)
### ๐ฅ๏ธ Control Shell
- [ ] Start interactive shell in foreground
- [ ] Add command: `status`
- [ ] Add command: `start `
- [ ] Add command: `stop `
- [ ] Add command: `restart `
- [ ] Add command: `reload`
- [ ] Add command: `exit`
- [ ] Implement line editing & command history
### ๐ Configuration Support
- [ ] Support all required config options:
- [ ] `cmd`
- [ ] `numprocs`
- [ ] `autostart`
- [ ] `autorestart` (always / never / unexpected)
- [ ] `exitcodes`
- [ ] `startretries`, `starttime`
- [ ] `stopsignal`, `stoptime`
- [ ] `stdout`, `stderr`
- [ ] `env`
- [ ] `workingdir`
- [ ] `umask`
### ๐งช Testing & Edge Cases
- [ ] Handle invalid config entries
- [ ] Handle programs that crash immediately
- [ ] Simulate manual process kills
- [ ] Test high-output programs
- [ ] Test multiple process instances per program
---
## ๐ฏ Learning Objectives
- Deep understanding of Unix **process management** (fork/exec, signals, waitpid)
- Mastering **inter-process communication**
- Advanced **file I/O** and **logging**
- Using **signals** in C++ (`signal`, `sigaction`)
- Implementing a **command-line interface** from scratch
- Working with **configuration files** (YAML or manual parsing)
- Managing **process groups** and **graceful shutdowns**
---
## ๐ Recommended Tools / Libraries
- **C++17+** with STL
- [`yaml-cpp`](https://github.com/jbeder/yaml-cpp) โ for YAML parsing (optional)
- `std::thread`, `std::mutex`, `std::condition_variable` โ for concurrency
- `readline` or custom implementation โ for CLI editing/history
- `std::filesystem` โ for file and directory handling
---
## ๐ References
- [`supervisord`](http://supervisord.org/) โ inspiration/reference
- `man 2 fork`, `man 2 execve`, `man 2 waitpid`
- `man 7 signal`, `man 2 kill`
- [Linux Process Management Guide (TLPI)](https://man7.org/tlpi/)
---
## ๐ฆ Final Deliverable
- Source code with Makefile
- Example configuration file
- README and documentation
- Test scripts or manual test cases
---
## โ Author
- Azer Sioud | asioud