A unified process supervisor script for managing applications across macOS and Linux platforms.
- Cross-platform compatibility: Works seamlessly on macOS and Linux
- Process management: Start, stop, restart, and monitor applications
- Port conflict resolution: Automatically handles port conflicts
- Code change watching: Optional automatic restart on file changes
- Logging: Comprehensive logging with timestamps
- Signal handling: Graceful shutdown and restart via signals
- Multiple instance prevention: Ensures only one supervisor per application
- Copy
.supervisor.exampleto.supervisorin your project directory - Configure your application settings:
APP_NAME="MyApp" COMMAND="python -m myapp" PORT=8000
- Start your application:
./supervisor.sh start
./supervisor.sh start # Start the supervisor and application
./supervisor.sh stop # Stop both supervisor and application
./supervisor.sh restart # Restart the application via signal
./supervisor.sh status # Check status of supervisor and app
./supervisor.sh logs # Tail the supervisor logs
./supervisor.sh reboot # Stop all supervisor instancesThe supervisor uses a .supervisor configuration file. See .supervisor.example for all available options.
APP_NAME: Name of your applicationCOMMAND: Command to start your application
PORT: Port to monitor (default: 4998)WATCH_CODE_CHANGES: Enable/disable file watching (default: true)WATCH_PATTERN: File pattern to watch (default: *.py)RESTART_EXIT_CODE: Exit code that triggers restart (default: 42)
Run the comprehensive test suite to verify cross-platform functionality:
# Run all tests
make test
# Run tests with verbose output
make test-verbose
# Clean up test artifacts
make cleanThe test suite covers:
- Platform compatibility (macOS/Linux)
- Basic functionality (start/stop/restart)
- Port conflict handling
- Configuration loading
- Log management
- Code change detection
This project uses GitHub Actions for continuous integration:
- Multi-platform testing: Tests run on both Ubuntu and macOS
- Shell linting: Static analysis with shellcheck
- Security scanning: Automated security checks
- Artifact collection: Test logs preserved on failure
See TESTING.md for detailed testing information.
| Platform | Status | Notes |
|---|---|---|
| macOS | ✅ Full support | BSD-style commands |
| Linux | ✅ Full support | GNU-style commands |
| Windows | ❌ Not supported | Use WSL |
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass:
make test - Submit a pull request
This project is part of the Simply project suite.