mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +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("-out")
|
||||
.arg(&cert_path)
|
||||
.invoke("OpenSSL GenKey")
|
||||
.invoke("OpenSSL CA")
|
||||
.await?;
|
||||
}
|
||||
let fullchain_path = base_path.join("cert-local.fullchain.crt.pem");
|
||||
|
||||
@@ -46,8 +46,18 @@ impl VersionT for Version {
|
||||
Ok(())
|
||||
}
|
||||
async fn down(&self) -> Result<(), Error> {
|
||||
tokio::fs::remove_file("/etc/nginx/sites-enabled/start9-services.conf").await?;
|
||||
tokio::fs::remove_file(crate::tor::ETC_NGINX_SERVICES_CONF).await?;
|
||||
tokio::fs::remove_file("/etc/nginx/sites-enabled/start9-services.conf")
|
||||
.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")
|
||||
.args(&["nginx", "reload"])
|
||||
.status()?;
|
||||
|
||||
Reference in New Issue
Block a user