From 7ae14f35dd567ab3d6393daed21c3d57df694140 Mon Sep 17 00:00:00 2001 From: Carsten Date: Wed, 22 Apr 2026 08:27:02 +0200 Subject: [PATCH] feat(agent): systemd unit + release env.sh for root+journald install --- agent/rel/env.sh.eex | 3 +++ agent/rel/proxmox-monitor-agent.service | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 agent/rel/env.sh.eex create mode 100644 agent/rel/proxmox-monitor-agent.service diff --git a/agent/rel/env.sh.eex b/agent/rel/env.sh.eex new file mode 100644 index 0000000..d09241e --- /dev/null +++ b/agent/rel/env.sh.eex @@ -0,0 +1,3 @@ +#!/bin/sh +# Default-logs to journald (stdout) when running under systemd +export RELEASE_COOKIE="${RELEASE_COOKIE:-$(head -c 16 /dev/urandom | od -An -tx1 | tr -d ' \n')}" diff --git a/agent/rel/proxmox-monitor-agent.service b/agent/rel/proxmox-monitor-agent.service new file mode 100644 index 0000000..15718a8 --- /dev/null +++ b/agent/rel/proxmox-monitor-agent.service @@ -0,0 +1,22 @@ +[Unit] +Description=Proxmox Monitor Agent +Documentation=https://github.com/you/proxmox_monitor +After=network-online.target zfs.target +Wants=network-online.target + +[Service] +Type=simple +User=root +Environment=AGENT_CONFIG=/etc/proxmox-monitor/agent.toml +ExecStart=/usr/local/bin/proxmox-monitor-agent start +ExecStop=/usr/local/bin/proxmox-monitor-agent stop +Restart=always +RestartSec=5 +# Burrito unpacks into this directory; keep it stable across runs +Environment=BURRITO_CACHE_DIR=/var/cache/proxmox-monitor-agent + +# Resource limits +LimitNOFILE=65536 + +[Install] +WantedBy=multi-user.target