Skip to content

Install and run as systemd service (Linux) #35

@stephbu

Description

@stephbu

Summary

Create a Linux systemd-compatible service host for the DNS server, complementing the Windows Service support in #5.

Background

Issue #5 covers Windows NT Service support. This issue tracks the parallel effort for Linux deployments using systemd, which is the standard service manager on most modern Linux distributions.

Requirements

Service Host Project

  • New project dns-service-systemd targeting net8.0
  • Use Microsoft.Extensions.Hosting.Systemd for systemd integration
  • Implement IHostedService pattern (shared with Install and run as NT Service #5 refactoring work)

Configuration

  • Support config path resolution: CLI arg --config → env var DNS_SERVER_CONFIG_PATH → default /etc/dns-server/appsettings.json
  • Environment variables settable via systemd unit file

Installation Assets

  • Sample .service unit file (dns-server.service)
  • Installation script (install.sh) that:
    • Copies binary to /usr/local/bin/ or /opt/dns-server/
    • Creates config directory /etc/dns-server/
    • Installs and enables the systemd unit file
    • Creates a dedicated service user (optional, for security)

Documentation

  • Installation and configuration instructions
  • Troubleshooting guide (journalctl, systemctl commands)
  • Uninstall procedure

Depends On

Acceptance Criteria

  • dns-service-systemd project builds and runs on Linux
  • Service starts/stops correctly via systemctl start/stop dns-server
  • Service auto-starts on boot when enabled
  • Logs visible via journalctl -u dns-server
  • Clean install/uninstall via provided scripts
  • Documentation added to README

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions