#2 feat: add systemd config file

Хаасан
нээсэн 11 сар өмнө by fszontagh · 2 саналууд
Szontágh Ferenc санал үлдээсэн 11 сар өмнө
  • add a systemd config file to allow to run the project as service
  • keep attention to allow to run the project as unprivileged user (for example local UNIX user claude)
  • enhanche the logging to allow to systemd to handle the logging output (for example journalctl -u agent-manager -f -n100)
- add a systemd config file to allow to run the project as service - keep attention to allow to run the project as unprivileged user (for example local UNIX user claude) - enhanche the logging to allow to systemd to handle the logging output (for example journalctl -u agent-manager -f -n100)
Claude Coding Agent санал үлдээсэн 11 сар өмнө
Хамтрагч

Starting work on this issue. I'll implement:

  1. ✅ Systemd service file configured for unprivileged user (claude)
  2. ✅ Enhanced logging system that detects systemd environment
  3. ✅ Documentation for installation and usage

Working on it now...

Starting work on this issue. I'll implement: 1. ✅ Systemd service file configured for unprivileged user (claude) 2. ✅ Enhanced logging system that detects systemd environment 3. ✅ Documentation for installation and usage Working on it now...
Claude Coding Agent энэ асуудлыг 11 сар өмнө коммитоос иш татсан болно
Claude Coding Agent санал үлдээсэн 11 сар өмнө
Хамтрагч

Implementation completed and pushed! Here's what was done:

Changes

1. Systemd Service File (agent-manager.service)

  • Configured to run as unprivileged user claude
  • Includes security hardening: NoNewPrivileges, PrivateTmp, ProtectSystem=strict
  • Automatic restart on failure with 10-second delay
  • Logs to journalctl via StandardOutput/StandardError

2. Enhanced Logger (src/logger.js:6-14)

  • Auto-detects systemd environment via JOURNAL_STREAM and INVOCATION_ID env vars
  • Automatically disables colors and timestamps when running under systemd
  • journalctl already provides timestamps and doesn't render ANSI colors well
  • Still supports colored output with timestamps for regular console usage

3. Comprehensive Documentation (SYSTEMD.md)

  • Complete installation guide
  • Service management commands
  • Logging examples with journalctl
  • Troubleshooting section
  • Security features explanation
  • Advanced configuration options

4. Updated README

  • Added systemd service section with quick start
  • Links to detailed SYSTEMD.md documentation

Testing

Tested and verified:

  • Project starts and runs correctly
  • Logger auto-detection works (tested with JOURNAL_STREAM=test env var)
  • Output is clean without colors/timestamps in systemd mode
  • All changes committed and pushed

Usage

# Install the service
sudo cp agent-manager.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable agent-manager
sudo systemctl start agent-manager

# View logs
journalctl -u agent-manager -f -n100

Ready for review!

Implementation completed and pushed! Here's what was done: ## Changes ### 1. Systemd Service File (`agent-manager.service`) - Configured to run as unprivileged user `claude` - Includes security hardening: `NoNewPrivileges`, `PrivateTmp`, `ProtectSystem=strict` - Automatic restart on failure with 10-second delay - Logs to journalctl via StandardOutput/StandardError ### 2. Enhanced Logger (src/logger.js:6-14) - Auto-detects systemd environment via `JOURNAL_STREAM` and `INVOCATION_ID` env vars - Automatically disables colors and timestamps when running under systemd - journalctl already provides timestamps and doesn't render ANSI colors well - Still supports colored output with timestamps for regular console usage ### 3. Comprehensive Documentation (`SYSTEMD.md`) - Complete installation guide - Service management commands - Logging examples with journalctl - Troubleshooting section - Security features explanation - Advanced configuration options ### 4. Updated README - Added systemd service section with quick start - Links to detailed SYSTEMD.md documentation ## Testing Tested and verified: - Project starts and runs correctly - Logger auto-detection works (tested with `JOURNAL_STREAM=test` env var) - Output is clean without colors/timestamps in systemd mode - All changes committed and pushed ## Usage ```bash # Install the service sudo cp agent-manager.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable agent-manager sudo systemctl start agent-manager # View logs journalctl -u agent-manager -f -n100 ``` Ready for review!
Энэ хэлэлцүүлгэнд нэгдэхийн тулт та нэвтэрнэ үү.
Үе шат заахгүй
Хариуцагч байхгүй
2 Оролцогчид
Ачааллаж байна ...
Цуцлах
Хадгалах
Харуулах агуулга байхгүй байна.