@@ -255,14 +255,7 @@ impl Service {
255
255
name : & str ,
256
256
run_info : & RuntimeInfo ,
257
257
) -> Result < ( ) , RunCmdError > {
258
- let stop_res = self . run_stop_cmd ( conf, id, name, run_info. clone ( ) ) ;
259
- if conf. srcv_type != ServiceType :: OneShot {
260
- // already happened when the oneshot process exited in the exit handler
261
- self . kill_all_remaining_processes ( name) ;
262
- }
263
- self . pid = None ;
264
- self . process_group = None ;
265
- stop_res
258
+ self . run_stop_cmd ( conf, id, name, run_info. clone ( ) )
266
259
}
267
260
pub fn kill (
268
261
& mut self ,
@@ -523,7 +516,16 @@ impl Service {
523
516
}
524
517
let timeout = self . get_start_timeout ( conf) ;
525
518
let cmds = conf. stoppost . clone ( ) ;
526
- self . run_all_cmds ( & cmds, id, name, timeout, run_info. clone ( ) )
519
+ let res = self . run_all_cmds ( & cmds, id, name, timeout, run_info. clone ( ) ) ;
520
+
521
+ if conf. srcv_type != ServiceType :: OneShot {
522
+ // already happened when the oneshot process exited in the exit handler
523
+ self . kill_all_remaining_processes ( name) ;
524
+ }
525
+ self . pid = None ;
526
+ self . process_group = None ;
527
+
528
+ res
527
529
}
528
530
529
531
pub fn log_stdout_lines ( & mut self , name : & str , status : & UnitStatus ) -> std:: io:: Result < ( ) > {
0 commit comments