How rprtr258/pm works
Main Components
a. CLI Client Component:
• Located in /internal/cli
• Handles user commands (run, start, stop, delete, etc.)
• Interacts with the server component
b. Shim Component:
• Core process management functionality
• Handles process monitoring, restarts, watches
• Manages signals and shutdowns
c. Storage Components:
• Database system (in /internal/db)
• Log rotation system (in /internal/logrotation)
• File system watcher (in /internal/fsnotify)
d. Configuration Management:
• Jsonnet configuration parser
• Process configuration handling
• User Layer |
• Process Mgmt |
• Storage Layer |
Key Relationships
• CLI → Shim communication
• Shim → Managed Processes interaction
• Storage interactions (logs, DB, config)
• File system monitoring
Specific Elements
a. User Interface:
• CLI commands interface
• Configuration input (Jsonnet/JSON)
b. Process Management:
• Process lifecycle management
• Auto-restart mechanism
• Watch functionality
• Signal handling
c. Storage:
• Database tables
• Log files management
• Configuration storage
Important Architectural Details
• $HOME/.pm directory structure
• Systemd integration point
• Process state transitions
• Linux-specific components
Implementation Details to Highlight
• Core process types and configurations
• Error handling paths
• Log rotation mechanisms
• File system watch patterns
System integration points
This system design should help developers understand both the high-level architecture and the specific implementation details that make PM an effective process management tool.