Skip to content

Conversation

@CBenoit
Copy link
Member

@CBenoit CBenoit commented Oct 31, 2025

Update ceviche to 0.7.0 which improves systemd integration.

Here is the new strategy:

  • pkg-config detection: We query pkg-config --variable=systemdsystemunitdir systemd to get the distribution's preferred location. This works on most modern systems that have systemd development packages installed.

  • Fallback probing: If pkg-config is unavailable or doesn't return a result, we probe common directories in order:

    • /usr/lib/systemd/system
    • /lib/systemd/system

This fixes installation issues on RHEL-based distributions where systemd units are located in /usr/lib/systemd/system instead of /lib/systemd/ system.

Issue: DGW-317

@CBenoit CBenoit enabled auto-merge (squash) October 31, 2025 16:15
@CBenoit CBenoit requested a review from Copilot October 31, 2025 16:15
Copy link
Contributor

Copilot AI left a comment

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 upgrades the ceviche library from version 0.6 to 0.7 and updates Linux installation scripts accordingly. The ceviche library is used for service management in both the devolutions-gateway and devolutions-agent projects.

  • Upgraded ceviche dependency from version 0.6.x to 0.7 in both gateway and agent
  • Added CEVICHE_SYSTEMD_UNITDIR environment variable to RPM postinstall script
  • Fixed whitespace/indentation inconsistencies in Debian and RPM postinstall scripts

Reviewed Changes

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

Show a summary per file
File Description
devolutions-gateway/Cargo.toml Bumped ceviche dependency from 0.6.1 to 0.7
devolutions-agent/Cargo.toml Bumped ceviche dependency from 0.6 to 0.7
Cargo.lock Updated lock file with new ceviche 0.7.0 version and checksum
package/Linux/gateway/rpm/postinst Added CEVICHE_SYSTEMD_UNITDIR environment variable for service registration and fixed indentation
package/Linux/gateway/debian/postinst Fixed indentation from spaces to tabs

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


if [ -d /run/systemd/system ]; then
/usr/bin/devolutions-gateway service register >/dev/null
CEVICHE_SYSTEMD_UNITDIR="%{_unitdir}" /usr/bin/devolutions-gateway service register >/dev/null
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The RPM macro %{_unitdir} should be expanded during package build, not left as a literal string in the postinst script. RPM macros are processed at build time, but this postinst script runs at install time. This will pass the literal string '%{_unitdir}' as the environment variable value instead of the actual systemd unit directory path (typically /usr/lib/systemd/system). Consider either expanding this macro during package build or using the actual path directly.

Suggested change
CEVICHE_SYSTEMD_UNITDIR="%{_unitdir}" /usr/bin/devolutions-gateway service register >/dev/null
CEVICHE_SYSTEMD_UNITDIR="/usr/lib/systemd/system" /usr/bin/devolutions-gateway service register >/dev/null

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I may have misunderstood something here.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right.. Good catch copilot

@CBenoit CBenoit disabled auto-merge October 31, 2025 16:17
@CBenoit CBenoit marked this pull request as draft October 31, 2025 16:27
@CBenoit CBenoit changed the title build(dgw,agent): fix systemd integration build(dgw,agent): improve systemd integration Oct 31, 2025
Update ceviche to 0.7.0 which improves systemd integration.

Here is the new strategy:

- **pkg-config detection**: We query `pkg-config --variable=systemdsystemunitdir systemd`
to get the distribution's preferred location. This works on most modern systems that have systemd
development packages installed.

- **Fallback probing**: If pkg-config is unavailable or doesn't return a result, we probe common directories in order:

 - `/usr/lib/systemd/system`
 - `/lib/systemd/system`

This fixes installation issues on RHEL-based distributions where systemd
units are located in /usr/lib/systemd/system instead of /lib/systemd/
system.

Issue: DGW-317
@CBenoit CBenoit marked this pull request as ready for review October 31, 2025 16:33
@CBenoit CBenoit enabled auto-merge (squash) October 31, 2025 16:34
@CBenoit CBenoit merged commit 0d5239b into master Oct 31, 2025
38 checks passed
@CBenoit CBenoit deleted the DGW-317 branch October 31, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants