mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
appmgr: make down for 0.2.9 more resilient
This commit is contained in:
committed by
Aiden McClelland
parent
4fcdf5f832
commit
cfacbcabd3
@@ -299,7 +299,7 @@ pub async fn write_lan_services(hidden_services: &ServicesMap) -> Result<(), Err
|
|||||||
.arg(&req_path)
|
.arg(&req_path)
|
||||||
.arg("-out")
|
.arg("-out")
|
||||||
.arg(&cert_path)
|
.arg(&cert_path)
|
||||||
.invoke("OpenSSL GenKey")
|
.invoke("OpenSSL CA")
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
let fullchain_path = base_path.join("cert-local.fullchain.crt.pem");
|
let fullchain_path = base_path.join("cert-local.fullchain.crt.pem");
|
||||||
|
|||||||
@@ -46,8 +46,18 @@ impl VersionT for Version {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
async fn down(&self) -> Result<(), Error> {
|
async fn down(&self) -> Result<(), Error> {
|
||||||
tokio::fs::remove_file("/etc/nginx/sites-enabled/start9-services.conf").await?;
|
tokio::fs::remove_file("/etc/nginx/sites-enabled/start9-services.conf")
|
||||||
tokio::fs::remove_file(crate::tor::ETC_NGINX_SERVICES_CONF).await?;
|
.await
|
||||||
|
.or_else(|e| match e {
|
||||||
|
e if e.kind() == std::io::ErrorKind::NotFound => Ok(()),
|
||||||
|
e => Err(e),
|
||||||
|
})?;
|
||||||
|
tokio::fs::remove_file(crate::tor::ETC_NGINX_SERVICES_CONF)
|
||||||
|
.await
|
||||||
|
.or_else(|e| match e {
|
||||||
|
e if e.kind() == std::io::ErrorKind::NotFound => Ok(()),
|
||||||
|
e => Err(e),
|
||||||
|
})?;
|
||||||
let svc_exit = std::process::Command::new("service")
|
let svc_exit = std::process::Command::new("service")
|
||||||
.args(&["nginx", "reload"])
|
.args(&["nginx", "reload"])
|
||||||
.status()?;
|
.status()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user