Skip to content

Commit

Permalink
services that fail while waiting for the READY=1 need to get their pi…
Browse files Browse the repository at this point in the history
…d/pgid cleared too. Moved from stop into posstop
  • Loading branch information
KillingSpark committed Apr 21, 2020
1 parent 513bf10 commit 151c55d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/services/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,7 @@ impl Service {
name: &str,
run_info: &RuntimeInfo,
) -> Result<(), RunCmdError> {
let stop_res = self.run_stop_cmd(conf, id, name, run_info.clone());
if conf.srcv_type != ServiceType::OneShot {
// already happened when the oneshot process exited in the exit handler
self.kill_all_remaining_processes(name);
}
self.pid = None;
self.process_group = None;
stop_res
self.run_stop_cmd(conf, id, name, run_info.clone())
}
pub fn kill(
&mut self,
Expand Down Expand Up @@ -523,7 +516,16 @@ impl Service {
}
let timeout = self.get_start_timeout(conf);
let cmds = conf.stoppost.clone();
self.run_all_cmds(&cmds, id, name, timeout, run_info.clone())
let res = self.run_all_cmds(&cmds, id, name, timeout, run_info.clone());

if conf.srcv_type != ServiceType::OneShot {
// already happened when the oneshot process exited in the exit handler
self.kill_all_remaining_processes(name);
}
self.pid = None;
self.process_group = None;

res
}

pub fn log_stdout_lines(&mut self, name: &str, status: &UnitStatus) -> std::io::Result<()> {
Expand Down

0 comments on commit 151c55d

Please sign in to comment.