This repository contains a Multi-Runner Command Orchestration System developed in C for Linux as part of the Operating Systems (Sistemas Operativos) course at the University of Minho.
The project implements a client-server architecture using two distinct programs—runner and controller—that interact via Named Pipes (FIFOs) to manage, schedule, and execute user bash commands concurrently.
- Acts as a central orchestrator daemon.
- Receives execution and status requests concurrently from multiple
runnerprocesses without blocking. - Implements custom scheduling policies to guarantee fairness among different user IDs.
- Manages parallel task execution based on a user-defined max concurrency limit.
- Logs execution statistics (User ID, Command ID, and total duration) persistently to a file.
- Acts as the client interface for users to submit bash commands (
-e), check the status of running/queued tasks (-c), or safely shut down the controller (-s) - Communicates intended execution requests to the controller and waits for authorization before triggering command execution
- Displays real-time state updates to the user via
stdout(submitted,executing,finished) - Advanced I/O Support: Implements process redirection and communication operators, supporting
>,2>,<, and|
This project was built from scratch without using forbidden functions such as system() or direct shell invocations. It actively utilizes core Operating Systems concepts learned in the course:
- Low-level I/O:
open,read,write, andclosesystem calls - Inter-Process Communication (IPC): Named Pipes (
mkfifo) to establish asynchronous communication channels between clients and the server, and anonimous pipes (pipe) to implement communication operator| - Process Management:
forkandexecfamily calls to create process hierarchies for executing commands. - Signal Handling & Redirection:
dup2for pipe and file redirection operators.
- Linux Environment
- GCC Compiler & Make
- Starting the Controller
./bin/controller <max-parallel-commands> <sched-policy>- Executing Commands (Runner)
./bin/runner -e 1 "echo hello"- Commands with pipes and redirections:
./bin/runner -e 2 "grep system /etc/passwd | wc -l > out.txt"- Inspecting the Queue status
./bin/runner -c- Safe Shutdown
./bin/runner -s