#2 feat: add systemd config file

Đã đóng
%! (template.HTML=11 tháng trước cách đây)đang mở bởi fszontagh · 2 ý kiến
  • 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 đã nhận xét 11 tháng trước cách đây
Người hợp tác

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 đã nhận xét 11 tháng trước cách đây
Người hợp tác

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!
Đăng nhập để tham gia bình luận.
Không có Milestone
Không có người được phân công
2 tham gia
Đang tải...
Hủy bỏ
Lưu
Ở đây vẫn chưa có nội dung nào.