forked from lix-project/lix-installer
Use systemctl disable not enable, don't auto revert in no-confirm
This commit is contained in:
parent
fb4d1c7280
commit
6ef10ff50e
|
@ -90,9 +90,13 @@ impl Action for StartSystemdUnit {
|
|||
tracing::debug!("Stopping systemd unit");
|
||||
|
||||
// TODO(@Hoverbear): Handle proxy vars
|
||||
execute_command(Command::new("systemctl").arg("stop").arg(format!("{unit}")))
|
||||
.await
|
||||
.map_err(|e| StartSystemdUnitError::Command(e).boxed())?;
|
||||
execute_command(
|
||||
Command::new("systemctl")
|
||||
.arg("disable")
|
||||
.arg(format!("{unit}")),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| StartSystemdUnitError::Command(e).boxed())?;
|
||||
|
||||
tracing::trace!("Stopped systemd unit");
|
||||
*action_state = ActionState::Completed;
|
||||
|
|
|
@ -65,8 +65,10 @@ impl CommandExecute for Install {
|
|||
if !interaction::confirm(plan.describe_revert(explain)).await? {
|
||||
interaction::clean_exit_with_message("Okay, didn't do anything! Bye!").await;
|
||||
}
|
||||
plan.revert().await?
|
||||
} else {
|
||||
return Err(err).wrap_err("Install failure");
|
||||
}
|
||||
plan.revert().await?
|
||||
}
|
||||
|
||||
Ok(ExitCode::SUCCESS)
|
||||
|
|
Loading…
Reference in a new issue