mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
appmgr: fix: restart policy
This commit is contained in:
committed by
Aiden McClelland
parent
8b21ed13ce
commit
34d52d063e
@@ -478,7 +478,7 @@ pub async fn install_v0<R: AsyncRead + Unpin + Send + Sync>(
|
||||
let mut args = vec![
|
||||
Cow::Borrowed(OsStr::new("create")),
|
||||
Cow::Borrowed(OsStr::new("--restart")),
|
||||
Cow::Borrowed(OsStr::new("on-failure")),
|
||||
Cow::Borrowed(OsStr::new("no")),
|
||||
Cow::Borrowed(OsStr::new("--name")),
|
||||
Cow::Borrowed(OsStr::new(&manifest.id)),
|
||||
Cow::Borrowed(OsStr::new("--mount")),
|
||||
|
||||
@@ -14,6 +14,20 @@ impl VersionT for Version {
|
||||
&V0_2_8
|
||||
}
|
||||
async fn up(&self) -> Result<(), Error> {
|
||||
for (app_id, _) in crate::apps::list_info().await? {
|
||||
tokio::process::Command::new("docker")
|
||||
.arg("stop")
|
||||
.arg(&app_id)
|
||||
.invoke("Docker")
|
||||
.await?;
|
||||
tokio::process::Command::new("docker")
|
||||
.arg("update")
|
||||
.arg("--restart")
|
||||
.arg("no")
|
||||
.arg(&app_id)
|
||||
.invoke("Docker")
|
||||
.await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
async fn down(&self) -> Result<(), Error> {
|
||||
|
||||
Reference in New Issue
Block a user