mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-30 19:56:21 +00:00
feat: show systemd service logs in service details (#2440)
Co-authored-by: hank <hank@henrygd.me>
This commit is contained in:
@@ -1389,6 +1389,13 @@ EOF
|
||||
[ "$HUB_URL_PROVIDED" = "true" ] && sed -i "s|^Environment=\"HUB_URL=.*\"|Environment=\"HUB_URL=$SED_HUB_URL\"|" /etc/systemd/system/beszel-agent.service
|
||||
fi
|
||||
|
||||
# Let the agent service (not the beszel user) read the system journal for service logs.
|
||||
# Admins can opt out with a drop-in that sets an empty SupplementaryGroups=.
|
||||
if getent group systemd-journal >/dev/null 2>&1 && ! grep -q '^SupplementaryGroups=' /etc/systemd/system/beszel-agent.service; then
|
||||
echo "Granting the agent service read access to the systemd journal"
|
||||
sed -i '/^User=beszel$/a SupplementaryGroups=systemd-journal' /etc/systemd/system/beszel-agent.service
|
||||
fi
|
||||
|
||||
# Load and start the service
|
||||
printf "\nLoading and starting the agent service...\n"
|
||||
systemctl daemon-reload
|
||||
|
||||
Reference in New Issue
Block a user