Skip to content

fix(agent): adding checks for session and explicit systemd requirement#191

Open
Dimfacion wants to merge 1 commit into
mainfrom
issue/166
Open

fix(agent): adding checks for session and explicit systemd requirement#191
Dimfacion wants to merge 1 commit into
mainfrom
issue/166

Conversation

@Dimfacion

@Dimfacion Dimfacion commented Jun 10, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • adding checks for session and explicit systemd requirement

Testing Instructions

  1. On linux arm64, try to install the agent for all the different mode
  2. Check they are all working or explicitly explain the issue

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Copilot AI review requested due to automatic review settings June 10, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Linux agent installer scripts’ handling of systemd-related prerequisites so installations fail with clearer messaging (and don’t abort silently under set -e when systemctl is-system-running returns a non-zero exit code such as degraded).

Changes:

  • Make systemctl is-system-running non-fatal under set -e by suppressing stderr and forcing success.
  • Add explicit prerequisite messaging for service/service-user modes when systemd is not in an acceptable state.
  • Add a session-user guard to ensure the systemd user manager is available before proceeding.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
installer/linux/agent-installer.sh Makes systemd state detection non-fatal and adds a prerequisite message for service installs.
installer/linux/agent-installer-session-user.sh Makes systemd state detection non-fatal and adds a check for a usable systemd user manager in the session-user flow.
installer/linux/agent-installer-service-user.sh Makes systemd state detection non-fatal and adds a prerequisite message for service-user installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to 7
systemd_status=$(systemctl is-system-running 2>/dev/null || true)

Comment on lines 19 to +20
echo "Systemd is in unexpected state: $systemd_status. Installation is not supported."
echo "Prerequisite: an active systemd system manager is required for service mode." >&2
Comment on lines +6 to 7
systemd_status=$(systemctl is-system-running 2>/dev/null || true)


os=$(uname | tr '[:upper:]' '[:lower:]')
systemd_status=$(systemctl is-system-running)
systemd_status=$(systemctl is-system-running 2>/dev/null || true)
Comment on lines 73 to +74
echo "Systemd is in unexpected state: $systemd_status. Installation is not supported."
echo "Prerequisite: an active systemd system manager is required for service-user mode." >&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: systemctl degraded for Linux agent

2 participants