Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| abcc5c5e40 | |||
| 3ea0194c6c | |||
| fb3ba3f2c1 |
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "linux-patch-api"
|
name = "linux-patch-api"
|
||||||
version = "0.3.9"
|
version = "0.3.12"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Echo <echo@moon-dragon.us>"]
|
authors = ["Echo <echo@moon-dragon.us>"]
|
||||||
description = "Secure remote package management API for Linux systems"
|
description = "Secure remote package management API for Linux systems"
|
||||||
|
|||||||
14
debian/changelog
vendored
14
debian/changelog
vendored
@ -1,3 +1,17 @@
|
|||||||
|
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
|
||||||
|
* When service is inactive but enabled, check if .socket unit is active
|
||||||
|
|
||||||
|
-- Echo <echo@moon-dragon.us> Mon, 05 May 2026 13:10:00 -0500
|
||||||
|
|
||||||
linux-patch-api (0.3.9-1) unstable; urgency=low
|
linux-patch-api (0.3.9-1) unstable; urgency=low
|
||||||
|
|
||||||
* Fix socket activation detection for service status healthy logic
|
* Fix socket activation detection for service status healthy logic
|
||||||
|
|||||||
@ -568,11 +568,12 @@ fn get_systemd_service_status(name: &str) -> Result<Option<ServiceStatus>> {
|
|||||||
|
|
||||||
let healthy = active_state == "active" && sub_state == "running";
|
let healthy = active_state == "active" && sub_state == "running";
|
||||||
|
|
||||||
|
|
||||||
// Check for socket activation: if service is inactive but enabled,
|
// Check for socket activation: if service is inactive but enabled,
|
||||||
// check if the corresponding .socket unit is active (listening)
|
// check if the corresponding .socket unit is active (listening)
|
||||||
let healthy = if !healthy && active_state == "inactive" && unit_file_state == "enabled" {
|
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")
|
if let Ok(socket_output) = Command::new("systemctl")
|
||||||
.args(["show", &socket_name, "--property=ActiveState", "--no-pager"])
|
.args(["show", &socket_name, "--property=ActiveState", "--no-pager"])
|
||||||
.output()
|
.output()
|
||||||
|
|||||||
Reference in New Issue
Block a user