mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-26 07:25:27 +08:00
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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user