File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use clap::Parser;
44use log:: LevelFilter ;
55
66use std:: os:: unix:: process:: CommandExt ;
7- use std:: process:: Command ;
7+ use std:: process:: { Command , Stdio } ;
88
99static SYSTEMD_ARGS_BOOTUPD : & [ & str ] = & [
1010 "--unit" ,
@@ -154,6 +154,14 @@ fn ensure_running_in_systemd() -> Result<()> {
154154 require_root_permission ( ) ?;
155155 let running_in_systemd = running_in_systemd ( ) ;
156156 if !running_in_systemd {
157+ // Clear any failure status that may have happened previously
158+ let _r = Command :: new ( "systemctl" )
159+ . arg ( "reset-failed" )
160+ . arg ( "bootupd.service" )
161+ . stdout ( Stdio :: null ( ) )
162+ . stderr ( Stdio :: null ( ) )
163+ . spawn ( ) ?
164+ . wait ( ) ?;
157165 let r = Command :: new ( "systemd-run" )
158166 . args ( SYSTEMD_ARGS_BOOTUPD )
159167 . args ( std:: env:: args ( ) )
You can’t perform that action at this time.
0 commit comments