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;
4
4
use log:: LevelFilter ;
5
5
6
6
use std:: os:: unix:: process:: CommandExt ;
7
- use std:: process:: Command ;
7
+ use std:: process:: { Command , Stdio } ;
8
8
9
9
static SYSTEMD_ARGS_BOOTUPD : & [ & str ] = & [
10
10
"--unit" ,
@@ -154,6 +154,14 @@ fn ensure_running_in_systemd() -> Result<()> {
154
154
require_root_permission ( ) ?;
155
155
let running_in_systemd = running_in_systemd ( ) ;
156
156
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 ( ) ?;
157
165
let r = Command :: new ( "systemd-run" )
158
166
. args ( SYSTEMD_ARGS_BOOTUPD )
159
167
. args ( std:: env:: args ( ) )
You can’t perform that action at this time.
0 commit comments