updating rpm builds #2251
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2251
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2251/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1671
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1671
Original created: 2025-09-29T15:43:13Z
Original updated: 2025-09-29T15:45:33Z
Original head: carverauto/serviceradar:packaging/proton_rpm_broken
Original base: main
Original merged: 2025-09-29T15:45:29Z by @mfreeman451
PR Type
Enhancement
Description
Add automatic service management to RPM packages
Enable services on fresh install, restart on upgrade
Improve systemd integration across all serviceradar components
Diagram Walkthrough
File Walkthrough
22 files
Add service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicAdd service auto-start logicImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1671#issuecomment-3347734848
Original created: 2025-09-29T15:43:55Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Macro Duplication
The manual systemctl calls duplicate %systemd_post behavior and may conflict with distro policy; consider using the RPM macros (%systemd_post with Wants=, WantedBy=) or %systemd_post/%systemd_user_post patterns consistently to avoid double reloads or unexpected state.
Conditional Check
The test 'if [ $1 -eq 1 ]' is unquoted; if $1 is empty or unset it can cause a shell error. Use 'if [ "${1:-0}" -eq 1 ]' or case "$1" in 1) ... esac for robustness across script invocations.
Service Enablement
Enabling services on install may surprise users in managed environments; consider gating with a macro/boolean (e.g., %_enable_services) or honoring presets via 'systemctl preset --global' instead of unconditional enable.
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1671#issuecomment-3347744172
Original created: 2025-09-29T15:45:03Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Use RPM macros to avoid duplication
To avoid code duplication across 22 RPM spec files, define a custom RPM macro
for the repeated service management shell script. This will centralize the
logic, improving maintainability and consistency.
Examples:
packaging/specs/serviceradar-agent.spec [46-50]
packaging/specs/serviceradar-core.spec [58-62]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies significant code duplication across 22 files and proposes using a custom RPM macro, which is a best practice for improving maintainability and consistency.
Remove redundant service management commands
Remove the redundant
systemctl daemon-reload,systemctl enable, andsystemctlstartcommands from the%postscriptlet. The newly addedifblock alreadyhandles enabling and starting the service on initial installation.
packaging/specs/serviceradar-poller.spec [39-51]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly points out that the PR introduces code that makes existing service management commands (
daemon-reload,enable,start) redundant. Removing these lines is a critical cleanup to prevent duplicate operations and potential race conditions during package installation.Simplify service handling in post-install
In the
%postscriptlet, remove theelseblock containingsystemctl try-restart.This avoids redundant service restarts on upgrade, which should be handled by
the
%systemd_postun_with_restartmacro.packaging/specs/serviceradar-agent.spec [46-50]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies that using
try-restartin the%postscriptlet is redundant if%systemd_postun_with_restartis used for upgrades, which is a standard packaging practice. Removing theelseblock simplifies the script and avoids a potential double-restart on upgrades.