Skip to content
devreddy1015Public

About

C++ process supervisor: restarts a crashed process, tracks memory through /proc, enforces restart limits.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Smart Process Watchdog

A lightweight Smart Process Watchdog in C++ that monitors a target process, auto-restarts it on crash, and can detect resource anomalies (memory spikes). Designed as a learning project to understand process management, signals, /proc parsing, and basic supervision logic.

Features

  • Spawn target process using fork + execvp
  • Detect child exit/crash via waitpid
  • Monitor memory usage via /proc/<pid>/status (VmRSS)
  • Auto-restart with configurable restart limits and windows
  • Simple trend detection (memory increase warnings)
  • Logging to logs/watchdog.log
  • Optional daemon mode

Requirements (Arch Linux)

Install build dependencies:

sudo pacman -S base-devel gcc

Build & Run (Arch Linux)

# Build the watchdog and test applications
make

# Run the watchdog
./watchdog config/config.json

# Monitor logs in real-time
tail -f logs/watchdog.log

# Optional: Install system-wide
sudo make install

# Optional: Uninstall
sudo make uninstall

Project structure

About

C++ process supervisor: restarts a crashed process, tracks memory through /proc, enforces restart limits.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages