Conversation
There was a problem hiding this comment.
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-runningnon-fatal underset -eby 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.
| systemd_status=$(systemctl is-system-running 2>/dev/null || true) | ||
|
|
| 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) |
|
Thank you for your contribution. This PR is but one step away from being ready for merging: all commits must be PGP-signed. To get started, please see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
8600356 to
768de80
Compare
Signed-off-by: Gael Leblan <gael.leblan@filigran.io>
| @@ -71,6 +71,7 @@ fi | |||
|
|
|||
| if [ "$systemd_status" != "running" ] && [ "$systemd_status" != "degraded" ]; then | |||
| echo "Systemd is in unexpected state: $systemd_status. Installation is not supported." | |||
There was a problem hiding this comment.
If systemd_status = true, the message is:
echo "Systemd is in unexpected state: $(true). Installation is not supported." (same comment as Copilot)
|
Code is OK, just a small fix related to the display message. |
Proposed changes
Testing Instructions
Related issues
Checklist