← Back to Docs
Recipe: systemd unit file writer
Generate and deploy a systemd service unit for Meridian agents on Linux endpoints. This recipe covers templating, validation, and atomic install with rollback on failure.
Prerequisites
- Meridian agent binary installed at /opt/meridian/agent
- systemd ≥ 245 (systemctl --version)
- Root or sudo access for unit deployment
Unit template
[Unit] Description=Meridian Agent After=network-online.target Wants=network-online.target [Service] Type=simple ExecStart=/opt/meridian/agent --config /etc/meridian/agent.toml Restart=always RestartSec=10 User=meridian Group=meridian ProtectSystem=strict ProtectHome=true NoNewPrivileges=true [Install] WantedBy=multi-user.target
Deployment steps
- Write unit to
/etc/systemd/system/meridian-agent.service - Run
systemctl daemon-reload - Enable with
systemctl enable meridian-agent - Start with
systemctl start meridian-agent - Verify:
systemctl status meridian-agent
Rollback
If the agent fails to start, systemd will retry per RestartSec. To revert, stop and disable the unit, then restore the previous binary and config from your backup path.