Best Practices
Best Practices
- Always use PID files - Track running processes reliably
- Implement graceful shutdown - Handle SIGTERM properly
- Log to files - Use
/tmp/or dedicated log directory - Check before start - Prevent duplicate instances
- Clean stale PIDs - Remove orphaned PID files
- Add status monitoring - Show resource usage
- Support restart - Stop + start in one command
- Environment variables - Configure via env, not hardcoded