Systemd Deployment Guide
This guide explains how to deploy InterLink components using systemd services for production environments. Systemd provides automatic startup, restart on failure, proper logging, and robust service management.
Overview
Using systemd to manage InterLink components offers several advantages:
- Automatic startup: Services start automatically on boot
- Automatic restart: Failed services are automatically restarted
- Centralized logging: Logs are managed through journald
- Process supervision: Systemd monitors service health
- Security isolation: Services run with limited privileges
- Dependency management: Services start in the correct order
Prerequisites
- SystemD-enabled Linux distribution (most modern distributions)
- Root access to create system services
- InterLink binaries and configuration files
- Basic understanding of systemd service files
System Setup
Create System User
First, create a dedicated system user for running InterLink services:
sudo useradd --system --create-home --home-dir /opt/interlink --shell /bin/bash interlink
sudo mkdir -p /opt/interlink/{bin,config,logs}
sudo chown -R interlink:interlink /opt/interlink
Copy Binaries and Configuration
Move your InterLink components to the system directories:
# Copy binaries
sudo cp $HOME/.interlink/bin/* /opt/interlink/bin/
sudo cp $HOME/.interlink/manifests/interlink-remote.sh /opt/interlink/bin/
sudo chmod +x /opt/interlink/bin/*
# Copy configuration files
sudo cp $HOME/.interlink/config/* /opt/interlink/config/
sudo cp $HOME/.interlink/manifests/*.yaml /opt/interlink/config/
# Set ownership
sudo chown -R interlink:interlink /opt/interlink