fix: use resolved service name for socket activation detection
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 1m11s
CI/CD Pipeline / Unit Tests (push) Successful in 1m29s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Build Arch Package (push) Successful in 1m57s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 1m57s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m23s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m35s
CI/CD Pipeline / Build RPM Package (push) Successful in 3m54s
All checks were successful
CI/CD Pipeline / Code Format (push) Successful in 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 1m11s
CI/CD Pipeline / Unit Tests (push) Successful in 1m29s
CI/CD Pipeline / Security Audit (push) Successful in 5s
CI/CD Pipeline / Build Arch Package (push) Successful in 1m57s
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Successful in 1m57s
CI/CD Pipeline / Build Debian Package (push) Successful in 2m23s
CI/CD Pipeline / Build Alpine Package (push) Successful in 3m35s
CI/CD Pipeline / Build RPM Package (push) Successful in 3m54s
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "linux-patch-api"
|
||||
version = "0.3.10"
|
||||
version = "0.3.12"
|
||||
edition = "2021"
|
||||
authors = ["Echo <echo@moon-dragon.us>"]
|
||||
description = "Secure remote package management API for Linux systems"
|
||||
|
||||
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
linux-patch-api (0.3.12-1) unstable; urgency=low
|
||||
|
||||
* Fix socket activation detection to use resolved service name
|
||||
* Queries like "sshd" now correctly resolve to "ssh.socket" for socket activation
|
||||
|
||||
-- Echo <echo@moon-dragon.us> Tue, 06 May 2026 20:42:00 -0500
|
||||
|
||||
linux-patch-api (0.3.10-1) unstable; urgency=low
|
||||
|
||||
* Fix socket activation detection for service status healthy logic
|
||||
|
||||
@ -571,7 +571,9 @@ fn get_systemd_service_status(name: &str) -> Result<Option<ServiceStatus>> {
|
||||
// Check for socket activation: if service is inactive but enabled,
|
||||
// check if the corresponding .socket unit is active (listening)
|
||||
let healthy = if !healthy && active_state == "inactive" && unit_file_state == "enabled" {
|
||||
let socket_name = format!("{}.socket", name.trim_end_matches(".service"));
|
||||
// Use the resolved service name (id) instead of input name,
|
||||
// so "sshd" resolves to "ssh.service" → "ssh.socket" correctly
|
||||
let socket_name = format!("{}.socket", id.trim_end_matches(".service"));
|
||||
if let Ok(socket_output) = Command::new("systemctl")
|
||||
.args(["show", &socket_name, "--property=ActiveState", "--no-pager"])
|
||||
.output()
|
||||
|
||||
Reference in New Issue
Block a user