mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 18:21:51 +02:00
✨ feat(mac-mini): add stability improvements
High priority stability features: - Add all LaunchD plists to Git for version control - Handle crash-looping containers (Restarting status) in ensure-containers.sh - Add database backup script with daily/weekly rotation - Add Docker log rotation setup (50MB max, 3 files per container) New files: - scripts/mac-mini/backup-databases.sh - Daily pg_dump with rotation - scripts/mac-mini/setup-docker-logging.sh - Configure daemon.json - scripts/mac-mini/launchd/*.plist - All 8 LaunchD service configs - scripts/mac-mini/launchd/README.md - Documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
7d409465b6
commit
3de2f25552
12 changed files with 615 additions and 23 deletions
56
scripts/mac-mini/launchd/README.md
Normal file
56
scripts/mac-mini/launchd/README.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# LaunchD Services for Mac Mini
|
||||
|
||||
These plist files configure automatic services on the Mac Mini server.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Copy all plists to LaunchAgents
|
||||
cp *.plist ~/Library/LaunchAgents/
|
||||
|
||||
# Load all services
|
||||
for f in *.plist; do launchctl load ~/Library/LaunchAgents/$f; done
|
||||
```
|
||||
|
||||
## Services
|
||||
|
||||
| Service | Description | Interval |
|
||||
|---------|-------------|----------|
|
||||
| `docker-startup` | Starts Docker containers on boot | At login |
|
||||
| `ensure-containers` | Detects and restarts stuck containers | Every 5 min |
|
||||
| `health-check` | Checks all services and sends alerts | Every 5 min |
|
||||
| `ssd-check` | Monitors SSD health | Periodic |
|
||||
| `mana-stt` | Speech-to-text service (Whisper) | At login |
|
||||
| `mana-tts` | Text-to-speech service (Kokoro) | At login |
|
||||
| `image-gen` | Image generation service | At login |
|
||||
| `telegram-ollama-bot` | Telegram bot with Ollama | At login |
|
||||
|
||||
## Management Commands
|
||||
|
||||
```bash
|
||||
# Check status
|
||||
launchctl list | grep manacore
|
||||
|
||||
# View logs
|
||||
tail -f /tmp/manacore-*.log
|
||||
|
||||
# Reload a service
|
||||
launchctl unload ~/Library/LaunchAgents/com.manacore.health-check.plist
|
||||
launchctl load ~/Library/LaunchAgents/com.manacore.health-check.plist
|
||||
|
||||
# Stop a service
|
||||
launchctl unload ~/Library/LaunchAgents/com.manacore.<service>.plist
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Exit codes in `launchctl list`:
|
||||
- `0` = Running successfully
|
||||
- `1` = Last run had errors (check logs)
|
||||
- `-` = Not running / waiting for next interval
|
||||
- `78` = Configuration error
|
||||
|
||||
Check error logs:
|
||||
```bash
|
||||
cat /tmp/manacore-<service>.error.log
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue