mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-27 05:05:10 +00:00
cli: fix service failing to install on older systemd (#167672)
Fixes https://github.com/microsoft/vscode/issues/167671 In newer systemd, enablement is apparently implicit with 'link', but it must be called for older setups.
This commit is contained in:
@@ -92,6 +92,19 @@ impl ServiceManager for SystemdService {
|
||||
|
||||
info!(self.log, "Successfully registered service...");
|
||||
|
||||
// note: enablement is implicit in recent systemd version, but required for older systems
|
||||
// https://github.com/microsoft/vscode/issues/167489#issuecomment-1331222826
|
||||
proxy
|
||||
.enable_unit_files(
|
||||
vec![SystemdService::service_name_string()],
|
||||
/* 'runtime only'= */ false,
|
||||
/* replace existing = */ true,
|
||||
)
|
||||
.await
|
||||
.map_err(|e| wrap(e, "error enabling unit files for service"))?;
|
||||
|
||||
info!(self.log, "Successfully enabled unit files...");
|
||||
|
||||
proxy
|
||||
.start_unit(SystemdService::service_name_string(), "replace".to_string())
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user