fix(service): detect the service on OpenRC (#8187)

* fix(service): detect the service on OpenRC

* chore(deps): bump Service IPC and bundle to 2.8.1

* docs(changelog): note OpenRC service fixes

* docs(changelog): shorten OpenRC fix entry

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
Zakk
2026-11-16 08:18:25 +00:00
committed by GitHub
co-authored by Tunglies
parent 578986fd24
commit 11340794e1
4 changed files with 34 additions and 24 deletions
+6
View File
@@ -334,6 +334,12 @@ pub(crate) fn service_stop_reason() -> Result<Option<&'static str>> {
#[cfg(target_os = "linux")]
pub(crate) fn trusted_service_evidence() -> Result<bool> {
// Without systemd, the installer registers an OpenRC script instead of a unit.
if !Path::new("/run/systemd/system").exists() && Path::new("/run/openrc").exists() {
return Ok(Path::new("/etc/init.d")
.join(clash_verge_service_ipc::SERVICE_SLUG)
.exists());
}
let unit = format!("{}.service", clash_verge_service_ipc::SERVICE_SLUG);
let output = StdCommand::new("systemctl")
.args(["show", "--property=LoadState", "--value", &unit])