-
Notifications
You must be signed in to change notification settings - Fork 24
build(dgw,agent): improve systemd integration #1549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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_UNITDIRenvironment 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.
package/Linux/gateway/rpm/postinst
Outdated
|
|
||
| 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 |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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
Update ceviche to 0.7.0 which improves systemd integration.
Here is the new strategy:
pkg-config detection: We query
pkg-config --variable=systemdsystemunitdir systemdto 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/systemThis 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